Skip to content

Commit

Permalink
Merge pull request #1002 from rfcx/feature/add-columns-to-projects
Browse files Browse the repository at this point in the history
Created at and updated at columns migrations to projects are added
  • Loading branch information
rassokhin-s authored Jun 23, 2022
2 parents f080827 + 0a193e7 commit a5e9052
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
4 changes: 4 additions & 0 deletions DEPLOYMENT_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Arbimon Deployment Notes

## v3.0.55

- Run 028-add-created-at-updated-at-to-projects.sql on the staging/production sides

## v3.0.50

- Run 027-add-present-aed-to-recording-validations.sql on the production side
Expand Down
5 changes: 5 additions & 0 deletions scripts/db/028-add-created-at-updated-at-to-projects.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER TABLE `arbimon2`.`projects`
ADD COLUMN `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN `updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;

CREATE TRIGGER projects_update BEFORE UPDATE ON `arbimon2`.`projects` FOR EACH ROW SET NEW.updated_at = NOW();
5 changes: 5 additions & 0 deletions scripts/db/029-add-created-at-updated-at-to-species.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER TABLE `arbimon2`.`species`
ADD COLUMN `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN `updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;

CREATE TRIGGER species_update BEFORE UPDATE ON `arbimon2`.`species` FOR EACH ROW SET NEW.updated_at = NOW();
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
ALTER TABLE `arbimon2`.`recording_validations`
ADD COLUMN `created_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN `updated_at` TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;

CREATE TRIGGER recording_validations_update BEFORE UPDATE ON `arbimon2`.`recording_validations` FOR EACH ROW SET NEW.updated_at = NOW();

0 comments on commit a5e9052

Please sign in to comment.