nxy/schema.sql
2017-06-29 22:56:32 +02:00

48 lines
1.3 KiB
SQL

create table if not exists quotes (
id serial primary key,
nick varchar(30) not null,
item text not null,
unique (nick, item)
);
create table if not exists mcmaniacs (
id serial primary key,
item text not null,
unique (item)
);
create table if not exists timers (
id serial primary key,
nick varchar(30) not null,
channel varchar(32) not null,
message text not null,
delay varchar(10) not null,
ends_at timestamp not null,
created_at timestamp not null default current_timestamp
);
create table if not exists tells (
id serial primary key,
from_nick varchar(30) not null,
to_nick varchar(30) not null,
message text not null,
created_at timestamp not null default current_timestamp,
unique (to_nick, message)
);
create table if not exists seens (
id serial primary key,
nick varchar(30) not null,
channel varchar(32) not null,
message text not null,
seen_at timestamp not null,
unique (nick)
);
create table if not exists owes (
id serial primary key,
nick varchar(30) not null,
amount integer not null,
unique (nick)
);