-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path20240930090611-add-created-updated-field.sql
52 lines (38 loc) · 1.31 KB
/
20240930090611-add-created-updated-field.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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;