Add relation between posts and authors
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
-- This file should undo anything in `up.sql`
|
||||
DROP TABLE post_authors;
|
||||
@@ -0,0 +1,6 @@
|
||||
-- Your SQL goes here
|
||||
CREATE TABLE post_authors (
|
||||
id SERIAL PRIMARY KEY,
|
||||
post_id INTEGER REFERENCES posts(id) ON DELETE CASCADE NOT NULL,
|
||||
author_id INTEGER REFERENCES users(id) ON DELETE CASCADE NOT NULL
|
||||
)
|
||||
Reference in New Issue
Block a user