feed generation and accounts WIP
This commit is contained in:
23
tables.sql
23
tables.sql
@ -59,11 +59,30 @@ create table picrinth.swipes (
|
||||
username text not null,
|
||||
feed_id integer not null,
|
||||
picture_id integer not null,
|
||||
swipe_value smallint not null,
|
||||
swiped_at timestamp with time zone default now(),
|
||||
value smallint not null,
|
||||
created_at timestamp with time zone default now(),
|
||||
primary key (id),
|
||||
foreign key (username) references picrinth.users (username) on delete cascade on update cascade,
|
||||
foreign key (feed_id) references picrinth.feeds (id) on delete cascade on update cascade,
|
||||
foreign key (picture_id) references picrinth.pictures (id) on delete cascade on update cascade,
|
||||
constraint swipes_unique unique (username, feed_id, picture_id)
|
||||
);
|
||||
|
||||
create table picrinth.accounts (
|
||||
id serial not null,
|
||||
platform text not null,
|
||||
login text not null,
|
||||
password text not null,
|
||||
metadata jsonb null, -- meybe not needed
|
||||
created_at timestamp with time zone default now(),
|
||||
constraint unique_account_per_platform unique (platform, login)
|
||||
);
|
||||
|
||||
create table picrinth.group_accounts (
|
||||
groupname text not null,
|
||||
account_id int not null,
|
||||
created_at timestamp with time zone default now(),
|
||||
constraint unique_group_accounts unique (account_id, groupname)
|
||||
foreign key (groupname) references picrinth.groups (groupname) on delete cascade on update cascade
|
||||
foreign key (account_id) references picrinth.accounts (id) on delete cascade on update cascade
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user