TRUNCATE vn.beach; ALTER TABLE vn.beach CHANGE name name varchar(45) CHARACTER SET utf8 COLLATE utf8_unicode_ci NULL AFTER id; ALTER TABLE vn.beach DROP COLUMN x; ALTER TABLE vn.beach DROP COLUMN y; ALTER TABLE vn.beach DROP COLUMN isShowed; ALTER TABLE vn.beach DROP COLUMN name; ALTER TABLE vn.beach CHANGE id code varchar(45) NOT NULL; ALTER TABLE vn.beach MODIFY COLUMN code varchar(45) NOT NULL; ALTER TABLE vn.beach MODIFY COLUMN warehouseFk smallint(6) DEFAULT 60 NOT NULL; ALTER TABLE vn.routesMonitor ADD CONSTRAINT routesMonitor_FK_2 FOREIGN KEY (beachFk) REFERENCES vn.beach(code) ON DELETE RESTRICT ON UPDATE CASCADE; INSERT INTO vn.beach (code) VALUES ('p1'); INSERT INTO vn.beach (code) VALUES ('p2'); INSERT INTO vn.beach (code) VALUES ('p3'); INSERT INTO vn.beach (code) VALUES ('p4');