Compare commits

..

9 Commits

Author SHA1 Message Date
root 7928d0598b add sql 2019-06-25 17:02:39 +08:00
root 3bdfd83583 add new sql 2019-06-25 17:01:51 +08:00
root f0a256f088 fix 2019-05-22 22:48:35 +08:00
root 2e1f513107 add new schema 2019-05-22 22:25:56 +08:00
root 899a2fb0f2 modify message field length 2019-03-05 21:58:17 +08:00
root bda0992957 add new leg 2018-10-10 00:13:41 +08:00
root 5d3b60889f modify message log table 2018-10-02 00:11:10 +08:00
root 03ae87dcfe add more leg 2018-09-28 22:08:55 +08:00
root 265d85f0d3 fix schema 2018-09-27 21:48:20 +08:00
8 changed files with 234 additions and 3 deletions
+1 -1
View File
@@ -7,7 +7,7 @@ CREATE TABLE public.lottery
mtime timestamp with time zone DEFAULT current_timestamp NOT NULL mtime timestamp with time zone DEFAULT current_timestamp NOT NULL
); );
insert into "public"."lottery" ("type", "message") insert into "public"."lottery" ("type", "message") values
('leg', '0024.jpg'), ('leg', '0024.jpg'),
('leg', '0025.jpg'), ('leg', '0025.jpg'),
('leg', '0029.jpg'), ('leg', '0029.jpg'),
+112
View File
@@ -0,0 +1,112 @@
insert into "public"."lottery" ("type", "message") values
('leg', 'DSCF0017.jpg'),
('leg', 'DSCF0018.jpg'),
('leg', 'DSCF0019.jpg'),
('leg', 'DSCF0038.jpg'),
('leg', 'DSCF0042.jpg'),
('leg', 'DSCF0696.jpg'),
('leg', 'DSCF0702.jpg'),
('leg', 'DSCF0713.jpg'),
('leg', 'DSCF0717.jpg'),
('leg', 'DSCF0718.jpg'),
('leg', 'DSCF0719.jpg'),
('leg', 'DSCF0722.jpg'),
('leg', 'DSCF0725.jpg'),
('leg', 'DSCF0734.jpg'),
('leg', 'DSCF0735.jpg'),
('leg', 'DSCF0738.jpg'),
('leg', 'DSCF0757.jpg'),
('leg', 'DSCF0762.jpg'),
('leg', 'DSCF0763.jpg'),
('leg', 'DSCF0789.jpg'),
('leg', 'DSCF0793.jpg'),
('leg', 'DSCF0795.jpg'),
('leg', 'DSCF1225.jpg'),
('leg', 'DSCF1226.jpg'),
('leg', 'DSCF1232.jpg'),
('leg', 'DSCF1233.jpg'),
('leg', 'DSCF1262.jpg'),
('leg', 'DSCF1293.jpg'),
('leg', 'DSCF1294.jpg'),
('leg', 'DSCF1304.jpg'),
('leg', 'DSCF1306.jpg'),
('leg', 'DSCF1309.jpg'),
('leg', 'DSCF1512.jpg'),
('leg', 'DSCF1514.jpg'),
('leg', 'DSCF1515.jpg'),
('leg', 'DSCF1546.jpg'),
('leg', 'DSCF1547.jpg'),
('leg', 'DSCF1548.jpg'),
('leg', 'DSCF1550.jpg'),
('leg', 'DSCF2101.jpg'),
('leg', 'DSCF2102.jpg'),
('leg', 'DSCF2106.jpg'),
('leg', 'DSCF2110.jpg'),
('leg', 'DSCF2111.jpg'),
('leg', 'DSCF2137.jpg'),
('leg', 'DSCF2146.jpg'),
('leg', 'DSCF2153.jpg'),
('leg', 'DSCF3332.jpg'),
('leg', 'DSCF3333.jpg'),
('leg', 'DSCF3334.jpg'),
('leg', 'DSCF3340.jpg'),
('leg', 'DSCF3342.jpg'),
('leg', 'DSCF3350.jpg'),
('leg', 'DSCF3402.jpg'),
('leg', 'DSCF3407.jpg'),
('leg', 'DSCF3408.jpg'),
('leg', 'DSCF5007.jpg'),
('leg', 'DSCF5011.jpg'),
('leg', 'DSCF5012.jpg'),
('leg', 'DSCF5014.jpg'),
('leg', 'DSCF5023.jpg'),
('leg', 'DSCF5024.jpg'),
('leg', 'DSCF5052.jpg'),
('leg', 'DSCF5055.jpg'),
('leg', 'DSCF7324.jpg'),
('leg', 'DSCF7328.jpg'),
('leg', 'DSCF7329.jpg'),
('leg', 'DSCF7330.jpg'),
('leg', 'DSCF7331.jpg'),
('leg', 'DSCF7332.jpg'),
('leg', 'DSCF7333.jpg'),
('leg', 'DSCF7334.jpg'),
('leg', 'DSCF7335.jpg'),
('leg', 'DSCF7336.jpg'),
('leg', 'DSCF7337.jpg'),
('leg', 'DSCF7338.jpg'),
('leg', 'DSCF7339.jpg'),
('leg', 'DSCF7341.jpg'),
('leg', 'DSCF7342.jpg'),
('leg', 'DSCF7343.jpg'),
('leg', 'DSCF9432.jpg'),
('leg', 'DSCF9433.jpg'),
('leg', 'DSCF9435.jpg'),
('leg', 'DSCF9467.jpg'),
('leg', 'DSCF9500.jpg'),
('leg', 'DSCF9501.jpg'),
('leg', 'DSCF9507.jpg'),
('leg', 'DSCF9509.jpg'),
('leg', 'DSCF9957.jpg'),
('leg', 'DSCF9958.jpg'),
('leg', 'IMG_1400.jpg'),
('leg', 'IMG_1402.jpg'),
('leg', 'IMG_1405.jpg'),
('leg', 'IMG_1420.jpg'),
('leg', 'IMG_1423.jpg'),
('leg', 'IMG_1427.jpg'),
('leg', 'IMG_1437.jpg'),
('leg', 'IMG_1445.jpg'),
('leg', 'IMG_1446.jpg'),
('leg', 'IMG_1481.jpg'),
('leg', 'IMG_1482.jpg'),
('leg', 'IMG_1492.jpg'),
('leg', 'IMG_1495.jpg'),
('leg', 'IMG_1499.jpg'),
('leg', 'IMG_1506.jpg'),
('leg', 'RNG01774.jpg'),
('leg', 'RNG01783.jpg'),
('leg', 'RNG01800.jpg'),
('leg', 'RNG01822.jpg'),
('leg', 'RNG01860.jpg'),
('leg', 'RNG01889.jpg');
+1
View File
@@ -0,0 +1 @@
ALTER TABLE public.line_message_log ADD type varchar(32) DEFAULT 'text' NOT NULL;
+68
View File
@@ -0,0 +1,68 @@
insert into "public"."lottery" ("type", "message") values
('leg', '0005.jpg'),
('leg', '0008.jpg'),
('leg', '0014.jpg'),
('leg', '0018.jpg'),
('leg', '0029.jpg'),
('leg', '0034.jpg'),
('leg', '0035.jpg'),
('leg', '0038.jpg'),
('leg', '0042.jpg'),
('leg', 'DSCF1544.JPG'),
('leg', 'DSCF1545.JPG'),
('leg', 'DSCF1547.JPG'),
('leg', 'DSCF1557.JPG'),
('leg', 'DSCF1558.JPG'),
('leg', 'DSCF1559.JPG'),
('leg', 'DSCF1560.JPG'),
('leg', 'DSCF1562.JPG'),
('leg', 'DSCF1563.JPG'),
('leg', 'DSCF1577.JPG'),
('leg', 'DSCF1578.JPG'),
('leg', 'DSCF1579.JPG'),
('leg', 'DSCF1595.JPG'),
('leg', 'DSCF1596.JPG'),
('leg', 'DSCF1597.JPG'),
('leg', 'DSCF1642.JPG'),
('leg', 'DSCF1643.JPG'),
('leg', 'DSCF1644.JPG'),
('leg', 'DSCF1663.JPG'),
('leg', 'DSCF1665.JPG'),
('leg', 'DSCF1674.JPG'),
('leg', 'DSCF1675.JPG'),
('leg', 'DSCF1677.jpg'),
('leg', 'DSCF1680.JPG'),
('leg', 'DSCF1692.JPG'),
('leg', 'DSCF1694.JPG'),
('leg', 'DSCF1710.JPG'),
('leg', 'DSCF1712.JPG'),
('leg', 'DSCF1760.JPG'),
('leg', 'DSCF1769.JPG'),
('leg', 'DSCF1770.JPG'),
('leg', 'DSCF1771.JPG'),
('leg', 'DSCF1772.JPG'),
('leg', 'DSCF1799.JPG'),
('leg', 'DSCF1800.JPG'),
('leg', 'DSCF1804.JPG'),
('leg', 'DSCF1819.JPG'),
('leg', 'DSCF1821.JPG'),
('leg', 'DSCF5022.jpg'),
('leg', 'DSCF5023.jpg'),
('leg', 'DSCF5034.jpg'),
('leg', 'DSCF5035.jpg'),
('leg', 'DSCF5036.jpg'),
('leg', 'DSCF5108.jpg'),
('leg', 'DSCF5119.jpg'),
('leg', 'DSCF5120.jpg'),
('leg', 'DSCF5122.jpg'),
('leg', 'hrka.cc10.jpg'),
('leg', 'hrka.cc11.jpg'),
('leg', 'hrka.cc1.jpg'),
('leg', 'hrka.cc2.jpg'),
('leg', 'hrka.cc3.jpg'),
('leg', 'hrka.cc4.jpg'),
('leg', 'hrka.cc5.jpg'),
('leg', 'hrka.cc6.jpg'),
('leg', 'hrka.cc7.jpg'),
('leg', 'hrka.cc8.jpg'),
('leg', 'hrka.cc9.jpg');
+4
View File
@@ -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);
+25
View File
@@ -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)
);
+15
View File
@@ -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;
+8 -2
View File
@@ -18,7 +18,13 @@
{"file": "20180816-1.sql", "version": 16}, {"file": "20180816-1.sql", "version": 16},
{"file": "20180826-1.sql", "version": 17}, {"file": "20180826-1.sql", "version": 17},
{"file": "20180828-1.sql", "version": 18}, {"file": "20180828-1.sql", "version": 18},
{"file": "20180927-1.sql", "version": 19} {"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": "20190305-1.sql", "version": 23},
{"file": "20190522-1.sql", "version": 24},
{"file": "20190625-1.sql", "version": 25}
], ],
"test": [] "test": []
} }