-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update: adds migrations alter for created and updater at fields
- Loading branch information
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
migrations/postgres/20240930090611-add-created-updated-field.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
|
||
-- +migrate Up | ||
ALTER TABLE branch | ||
ADD created_at timestamp with time zone DEFAULT now() NOT NULL, | ||
ADD updated_at timestamp with time zone DEFAULT now() NOT NULL; | ||
|
||
ALTER TABLE campaign | ||
ADD created_at timestamp with time zone DEFAULT now() NOT NULL, | ||
ADD updated_at timestamp with time zone DEFAULT now() NOT NULL; | ||
|
||
ALTER TABLE commerce | ||
ADD created_at timestamp with time zone DEFAULT now() NOT NULL, | ||
ADD updated_at timestamp with time zone DEFAULT now() NOT NULL; | ||
|
||
ALTER TABLE customer | ||
ADD created_at timestamp with time zone DEFAULT now() NOT NULL, | ||
ADD updated_at timestamp with time zone DEFAULT now() NOT NULL; | ||
|
||
ALTER TABLE purchase | ||
ADD created_at timestamp with time zone DEFAULT now() NOT NULL, | ||
ADD updated_at timestamp with time zone DEFAULT now() NOT NULL; | ||
|
||
ALTER TABLE reward | ||
ADD created_at timestamp with time zone DEFAULT now() NOT NULL, | ||
ADD updated_at timestamp with time zone DEFAULT now() NOT NULL; | ||
|
||
|
||
-- +migrate Down | ||
|
||
ALTER TABLE branch | ||
DROP COLUMN created_at, | ||
DROP COLUMN updated_at; | ||
|
||
ALTER TABLE campaign | ||
DROP COLUMN created_at, | ||
DROP COLUMN updated_at; | ||
|
||
ALTER TABLE commerce | ||
DROP COLUMN created_at, | ||
DROP COLUMN updated_at; | ||
|
||
ALTER TABLE customer | ||
DROP COLUMN created_at, | ||
DROP COLUMN updated_at; | ||
|
||
ALTER TABLE purchase | ||
DROP COLUMN created_at, | ||
DROP COLUMN updated_at; | ||
|
||
ALTER TABLE reward | ||
DROP COLUMN created_at, | ||
DROP COLUMN updated_at; |