gostart/schema.sql

54 lines
2.1 KiB
MySQL
Raw Normal View History

2022-11-29 19:55:00 -07:00
create table owners
(
2022-12-02 20:53:05 -07:00
id integer primary key not null,
created_at datetime default current_timestamp not null,
last_used datetime default current_timestamp not null,
name text not null unique
2022-11-29 19:55:00 -07:00
);
create table watch_items
(
id integer primary key autoincrement,
owner_id INTEGER REFERENCES owners (id) not null,
2022-11-29 19:55:00 -07:00
created_at datetime default current_timestamp not null,
name text not null,
repo text not null,
unique (name, repo)
2022-11-29 19:55:00 -07:00
);
create table pull_request_ignores
(
id integer primary key autoincrement,
owner_id INTEGER REFERENCES owners (id) not null,
2022-11-29 19:55:00 -07:00
created_at datetime default current_timestamp not null,
number integer not null,
repo text not null,
2022-11-29 19:55:00 -07:00
unique (number, repo)
);
create table links
(
id integer primary key autoincrement,
owner_id INTEGER REFERENCES owners (id) not null,
2022-11-29 19:55:00 -07:00
created_at datetime default current_timestamp not null,
url text not null unique,
name text not null,
2022-12-02 20:53:05 -07:00
clicked integer default 0 not null,
logo_url text not null
2022-11-29 19:55:00 -07:00
);
create table pull_requests
(
id integer primary key autoincrement,
owner_id INTEGER REFERENCES owners (id) not null,
2022-11-29 19:55:00 -07:00
created_at datetime default current_timestamp not null,
number integer not null unique,
repo text not null,
2022-12-02 20:53:05 -07:00
description text not null,
2022-11-29 19:55:00 -07:00
commitid text
);
create table icons
(
2022-12-02 20:53:05 -07:00
owner_id INTEGER REFERENCES owners (id) not null,
link_id integer primary key references links (id) not null,
created_at datetime default current_timestamp not null,
content_type text not null,
data blob not null
2022-11-29 19:55:00 -07:00
);