Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- # alter table wms.wms_in
- # drop foreign key wms_in_ibfk_1;
- #
- #
- #
- # create index idx_wms_in_supplier_id_document_id_create_date
- # on wms.wms_in (supplier_id, document_id, create_date);
- #
- #
- # ALTER TABLE wms.wms_product_in
- # drop foreign key wms_product_in_ibfk_2
- # , drop foreign key wms_product_in_ibfk_3
- # , drop foreign key wms_product_in_ibfk_4;
- #
- # UPDATE wms.wms_product_in
- # SET invoice_id = -1
- # WHERE invoice_id IS NULL;
- #
- # UPDATE wms.wms_product_in
- # SET fin_in_id = -1
- # WHERE fin_in_id IS NULL;
- #
- # ALTER TABLE wms.wms_product_in
- # modify document_id varchar(100) default '' not null
- # , modify invoice_id int default -1 not null
- # , modify fin_in_id int default -1 not null
- # , add index idx_wms_product_in_id (document_id, fin_in_id, invoice_id);
- #
- #
- #
- # create table if not exists wms.wms_in_new
- # (
- # id int(11) unsigned auto_increment
- # primary key,
- # document_id varchar(100) default '' not null,
- # supplier_id int default -1 not null,
- # create_date datetime default CURRENT_TIMESTAMP not null,
- # constraint unique (document_id)
- # , index (document_id, supplier_id, create_date)
- # )
- # charset = utf8;
- #
- #
- #
- # create table wms.wms_product_in_new
- # (
- # id int(11) unsigned auto_increment
- # primary key,
- # document_id varchar(100) default '' not null,
- # pa_id int null,
- # invoice_id int default -1 not null,
- # fin_in_id int default -1 not null,
- # cost decimal(10, 2) null,
- # remark varchar(255) null,
- # date_prihod datetime null,
- # name varchar(255) null,
- # foreign key (pa_id) references yii_doc.prices_all (id)
- # , index (document_id, fin_in_id, invoice_id)
- # , index (fin_in_id)
- # , index (invoice_id)
- # )
- # charset = utf8;
- # create index idx_wms_product_new_in_id
- # on wms.wms_product_in (document_id, fin_in_id, invoice_id);
- #
- # create index fin_in_id_new
- # on wms.wms_product_in (fin_in_id);
- #
- # create index invoice_id_new
- # on wms.wms_product_in (invoice_id);
- #
- # create index pa_id_new
- # on wms.wms_product_in (pa_id);
- #
- # grant insert, select, update on table wms.wms_product_in to developer_anton@localhost;
- #
- # INSERT INTO wms.wms_product_in_new
- # SELECT *
- # FROM wms.wms_product_in;
- #
- # RENAME TABLE wms.wms_product_in TO wms.wms_product_in_TO_REMOVE_2;
- # RENAME TABLE wms.wms_product_in_new TO wms.wms_product_in;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement