2018-05-29 10:08:38 +03:00
|
|
|
alter table connection
|
2018-05-31 16:18:52 +03:00
|
|
|
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,
|
2018-05-31 16:18:52 +03:00
|
|
|
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
|
2018-05-31 16:18:52 +03:00
|
|
|
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
|
2018-05-31 16:18:52 +03:00
|
|
|
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
|
|
|
|
(
|
2018-05-31 16:18:52 +03:00
|
|
|
id serial not null
|
2018-05-29 10:08:38 +03:00
|
|
|
constraint mapping_pkey
|
|
|
|
primary key,
|
|
|
|
site_code text,
|
|
|
|
bot_id text
|
2018-05-31 16:18:52 +03:00
|
|
|
);
|