Skip to content

Commit c1b491e

Browse files
authored
Merge pull request #59 from openhacku-saboten/morio/migration
`migrations`を更新
2 parents 7327995 + 308b97b commit c1b491e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

.docker/migrations/20210319141439-CreatePosts.sql

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ CREATE TABLE IF NOT EXISTS posts (
88
language VARCHAR(128) NOT NULL,
99
content TEXT,
1010
source VARCHAR(2048),
11-
created_at DATETIME NOT NULL,
12-
updated_at DATETIME NOT NULL,
11+
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
12+
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
1313
FOREIGN KEY (user_id) REFERENCES users (id)
1414
);
1515
-- +migrate Down

.docker/migrations/20210319143039-CreateComments.sql

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ CREATE TABLE IF NOT EXISTS comments (
99
first_line INTEGER,
1010
last_line INTEGER,
1111
code TEXT,
12-
created_at DATETIME NOT NULL,
13-
updated_at DATETIME NOT NULL,
12+
created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
13+
updated_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
1414
PRIMARY KEY (id, post_id),
1515
FOREIGN KEY (post_id) REFERENCES posts (id),
1616
FOREIGN KEY (user_id) REFERENCES users (id)

0 commit comments

Comments
 (0)