1
0
mirror of synced 2024-11-21 20:16:02 +03:00
mg-transport-telegram/migrations/1527515265_app.down.sql

33 lines
756 B
MySQL
Raw Permalink Normal View History

2018-05-29 10:08:38 +03:00
alter table connection
drop constraint connection_key,
2018-05-29 10:08:38 +03:00
alter column client_id drop not null,
alter column api_key drop not null,
alter column api_url drop not null,
alter column mg_url drop not null,
alter column mg_token drop not null,
alter column api_url type varchar(100),
alter column mg_url type varchar(100);
2018-05-29 10:08:38 +03:00
alter table bot
add column client_id varchar(70);
update bot b
set client_id = c.client_id
from connection c
where b.connection_id = c.id;
2018-05-29 10:08:38 +03:00
alter table bot
drop column connection_id,
alter column channel drop not null,
alter column token drop not null,
drop constraint bot_key;
2018-05-29 10:08:38 +03:00
create table mapping
(
id serial not null
2018-05-29 10:08:38 +03:00
constraint mapping_pkey
primary key,
site_code text,
bot_id text
);