Add a follow model

This commit is contained in:
Bat
2018-05-01 14:06:31 +01:00
parent 4daa482aa8
commit 78f3062f6d
5 changed files with 52 additions and 0 deletions
@@ -0,0 +1,2 @@
-- This file should undo anything in `up.sql`
DROP TABLE follows;
@@ -0,0 +1,6 @@
-- Your SQL goes here
CREATE TABLE follows (
id SERIAL PRIMARY KEY,
follower_id INTEGER REFERENCES users(id) ON DELETE CASCADE NOT NULL,
following_id INTEGER REFERENCES users(id) ON DELETE CASCADE NOT NULL
)