mirror of
https://github.com/muety/wakapi.git
synced 2023-08-10 21:12:56 +03:00
style: keep small column definitions together
This commit is contained in:
parent
edae516571
commit
7a339d77d3
@ -2,8 +2,7 @@
|
|||||||
-- SQL in section 'Up' is executed when this migration is applied
|
-- SQL in section 'Up' is executed when this migration is applied
|
||||||
create table aliases
|
create table aliases
|
||||||
(
|
(
|
||||||
id integer
|
id integer primary key autoincrement,
|
||||||
primary key autoincrement,
|
|
||||||
type integer not null,
|
type integer not null,
|
||||||
user_id varchar(255) not null,
|
user_id varchar(255) not null,
|
||||||
key varchar(255) not null,
|
key varchar(255) not null,
|
||||||
@ -18,8 +17,7 @@ create index idx_alias_user
|
|||||||
|
|
||||||
create table summaries
|
create table summaries
|
||||||
(
|
(
|
||||||
id integer
|
id integer primary key autoincrement,
|
||||||
primary key autoincrement,
|
|
||||||
user_id varchar(255) not null,
|
user_id varchar(255) not null,
|
||||||
from_time timestamp default CURRENT_TIMESTAMP not null,
|
from_time timestamp default CURRENT_TIMESTAMP not null,
|
||||||
to_time timestamp default CURRENT_TIMESTAMP not null
|
to_time timestamp default CURRENT_TIMESTAMP not null
|
||||||
@ -30,8 +28,7 @@ create index idx_time_summary_user
|
|||||||
|
|
||||||
create table summary_items
|
create table summary_items
|
||||||
(
|
(
|
||||||
id integer
|
id integer primary key autoincrement,
|
||||||
primary key autoincrement,
|
|
||||||
summary_id integer REFERENCES summaries (id) ON DELETE CASCADE ON UPDATE CASCADE,
|
summary_id integer REFERENCES summaries (id) ON DELETE CASCADE ON UPDATE CASCADE,
|
||||||
type integer,
|
type integer,
|
||||||
key varchar(255),
|
key varchar(255),
|
||||||
@ -40,17 +37,14 @@ create table summary_items
|
|||||||
|
|
||||||
create table users
|
create table users
|
||||||
(
|
(
|
||||||
id varchar(255)
|
id varchar(255) primary key,
|
||||||
primary key,
|
api_key varchar(255) unique,
|
||||||
api_key varchar(255)
|
|
||||||
unique,
|
|
||||||
password varchar(255)
|
password varchar(255)
|
||||||
);
|
);
|
||||||
|
|
||||||
create table heartbeats
|
create table heartbeats
|
||||||
(
|
(
|
||||||
id integer
|
id integer primary key autoincrement,
|
||||||
primary key autoincrement,
|
|
||||||
user_id varchar(255) not null REFERENCES users (id) ON DELETE RESTRICT ON UPDATE RESTRICT,
|
user_id varchar(255) not null REFERENCES users (id) ON DELETE RESTRICT ON UPDATE RESTRICT,
|
||||||
entity varchar(255) not null,
|
entity varchar(255) not null,
|
||||||
type varchar(255),
|
type varchar(255),
|
||||||
|
Loading…
Reference in New Issue
Block a user