Compare commits
5 Commits
bda0992957
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 7928d0598b | |||
| 3bdfd83583 | |||
| f0a256f088 | |||
| 2e1f513107 | |||
| 899a2fb0f2 |
@@ -0,0 +1,4 @@
|
||||
alter table "public".commands alter column message type varchar(2048) using message::varchar(2048);
|
||||
|
||||
alter table "public".key_commands alter column message type varchar(2048) using message::varchar(2048);
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
create table instagram
|
||||
(
|
||||
id varchar(256) not null
|
||||
constraint instagram_pk
|
||||
primary key,
|
||||
lastpost varchar(256) default '' not null,
|
||||
ctime timestamp with time zone default current_timestamp not null,
|
||||
mtime timestamp with time zone default current_timestamp not null
|
||||
);
|
||||
|
||||
create table line_ig_rt
|
||||
(
|
||||
line varchar(100) not null
|
||||
constraint line_ig_rt_line_group_id_fk
|
||||
references line_group
|
||||
on delete cascade,
|
||||
ig varchar(256) not null
|
||||
constraint line_ig_rt_instagram_id_fk
|
||||
references instagram
|
||||
on delete cascade,
|
||||
tmpl varchar(512) default '' not null,
|
||||
constraint line_ig_rt_pk
|
||||
primary key (line, ig)
|
||||
);
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
-- create line bot table
|
||||
CREATE TABLE public.line_bot (
|
||||
id uuid NOT NULL DEFAULT uuid_generate_v4(),
|
||||
"name" varchar(32) NOT NULL,
|
||||
access_token varchar(256) NOT NULL,
|
||||
secret varchar(256) NOT NULL,
|
||||
ctime timestamptz NOT NULL DEFAULT current_timestamp,
|
||||
mtime timestamptz NOT NULL DEFAULT current_timestamp,
|
||||
CONSTRAINT line_bot_pk PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
-- add bot fk to line_group table
|
||||
ALTER TABLE public.line_group ADD bot_id uuid NULL;
|
||||
-- add fk
|
||||
ALTER TABLE public.line_group ADD CONSTRAINT line_group_fk FOREIGN KEY (bot_id) REFERENCES public.line_bot(id) ON DELETE SET NULL;
|
||||
+5
-2
@@ -21,7 +21,10 @@
|
||||
{"file": "20180927-1.sql", "version": 19},
|
||||
{"file": "20180928-1.sql", "version": 20},
|
||||
{"file": "20181001-1.sql", "version": 21},
|
||||
{"file": "20181010-1.sql", "version": 22}
|
||||
{"file": "20181010-1.sql", "version": 22},
|
||||
{"file": "20190305-1.sql", "version": 23},
|
||||
{"file": "20190522-1.sql", "version": 24},
|
||||
{"file": "20190625-1.sql", "version": 25}
|
||||
],
|
||||
"test": []
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user