mirror of
https://github.com/yanislav-igonin/micrach
synced 2024-12-22 22:32:33 +03:00
feat: remove threads table from migration
This commit is contained in:
parent
5e4e6d6d98
commit
045dcf6fd2
@ -1,25 +1,22 @@
|
|||||||
-- UP
|
-- UP
|
||||||
-- Threads
|
|
||||||
CREATE TABLE threads
|
|
||||||
(
|
|
||||||
id SERIAL NOT NULL,
|
|
||||||
is_deleted BOOLEAN NOT NULL,
|
|
||||||
created_at TIMESTAMP DEFAULT NOW() NOT NULL,
|
|
||||||
updated_at TIMESTAMP DEFAULT NOW() NOT NULL,
|
|
||||||
PRIMARY KEY (id)
|
|
||||||
);
|
|
||||||
|
|
||||||
-- Posts
|
-- Posts
|
||||||
CREATE TABLE posts
|
CREATE TABLE posts
|
||||||
(
|
(
|
||||||
id SERIAL NOT NULL,
|
id SERIAL NOT NULL,
|
||||||
thread_id INTEGER NOT NULL,
|
|
||||||
|
is_parent BOOLEAN NOT NULL,
|
||||||
|
parent_id INT REFERENCES posts (id),
|
||||||
|
|
||||||
|
is_deleted BOOLEAN NOT NULL,
|
||||||
|
|
||||||
title VARCHAR NOT NULL,
|
title VARCHAR NOT NULL,
|
||||||
text TEXT NOT NULL,
|
text TEXT NOT NULL,
|
||||||
is_sage BOOLEAN NOT NULL,
|
is_sage BOOLEAN NOT NULL,
|
||||||
|
|
||||||
created_at TIMESTAMP DEFAULT NOW() NOT NULL,
|
created_at TIMESTAMP DEFAULT NOW() NOT NULL,
|
||||||
PRIMARY KEY (id),
|
updated_at TIMESTAMP DEFAULT NOW() NOT NULL,
|
||||||
FOREIGN KEY (thread_id) REFERENCES threads (id)
|
|
||||||
|
PRIMARY KEY (id)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -40,4 +37,3 @@ CREATE TABLE files
|
|||||||
-- DOWN
|
-- DOWN
|
||||||
DROP TABLE files;
|
DROP TABLE files;
|
||||||
DROP TABLE posts;
|
DROP TABLE posts;
|
||||||
DROP TABLE threads;
|
|
Loading…
Reference in New Issue
Block a user