pronounsfu/scripts/migrate/017_pride_flags.sql

31 lines
913 B
MySQL
Raw Normal View History

-- 2023-05-09: Add pride flags
-- Hashes are a separate table so we can deduplicate flags.
2023-08-15 18:30:34 -07:00
-- +migrate Up
create table pride_flags (
id text primary key,
user_id text not null references users (id) on delete cascade,
hash text not null,
name text not null,
description text
);
create table user_flags (
id bigint generated by default as identity primary key,
user_id text not null references users (id) on delete cascade,
flag_id text not null references pride_flags (id) on delete cascade
);
create table member_flags (
id bigint generated by default as identity primary key,
member_id text not null references members (id) on delete cascade,
flag_id text not null references pride_flags (id) on delete cascade
);
2023-08-15 18:30:34 -07:00
-- +migrate Down
drop table member_flags;
drop table user_flags;
drop table pride_flags;