Skip to content

Commit 584dcad

Browse files
committed
fix: update timestamp columns to tz
1 parent ad320bc commit 584dcad

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

database/db_init.sql

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ CREATE TABLE if NOT EXISTS proposals (
1717
type varchar(32) NOT NULL,
1818
status varchar(32) DEFAULT 'open' NOT NULL,
1919
id SERIAL PRIMARY KEY,
20-
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
21-
updated TIMESTAMP
20+
created TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP NOT NULL,
21+
updated TIMESTAMPTZ
2222
);
2323

2424
CREATE OR REPLACE TRIGGER set_updated
@@ -35,8 +35,8 @@ CREATE TABLE if NOT EXISTS votes (
3535
proposal_id INT NOT NULL REFERENCES proposals(id),
3636
vote varchar(32) NOT NULL,
3737
comment TEXT DEFAULT '' NOT NULL ,
38-
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
39-
updated TIMESTAMP,
38+
created TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP NOT NULL,
39+
updated TIMESTAMPTZ,
4040
id SERIAL PRIMARY KEY,
4141
CONSTRAINT unique_vote UNIQUE (voter_email, proposal_id)
4242
);
@@ -55,8 +55,8 @@ CREATE TABLE if NOT EXISTS drafts (
5555
description TEXT DEFAULT '' NOT NULL,
5656
type varchar(32) DEFAULT '' NOT NULL,
5757
id SERIAL PRIMARY KEY,
58-
created TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL,
59-
updated TIMESTAMP
58+
created TIMESTAMPTZ DEFAULT CURRENT_TIMESTAMP NOT NULL,
59+
updated TIMESTAMPTZ
6060
);
6161

6262
CREATE OR REPLACE TRIGGER set_updated

0 commit comments

Comments
 (0)