Modrinth/apps/labrinth/migrations/20210301041252_follows.sql
2024-10-16 14:11:42 -07:00

9 lines
289 B
SQL

CREATE TABLE mod_follows(
follower_id bigint REFERENCES users NOT NULL,
mod_id bigint REFERENCES mods NOT NULL,
created timestamptz DEFAULT CURRENT_TIMESTAMP NOT NULL,
PRIMARY KEY (follower_id, mod_id)
);
ALTER TABLE mods
ADD COLUMN follows integer NOT NULL default 0;