﻿CREATE TABLE IF NOT EXISTS bum_script_tb (
    script_id int NOT NULL,
    applied_date datetime NOT NULL,
    CONSTRAINT pk_bum_script PRIMARY KEY (script_id, applied_date)
);

CREATE TABLE IF NOT EXISTS bum_change_tb (
    change_id int NOT NULL,
    script_id int,
    applied_date datetime NOT NULL,
    CONSTRAINT pk_bum_change PRIMARY KEY (change_id, applied_date)
);

CREATE TRIGGER def_bum_script_date BEFORE INSERT ON bum_script_tb
FOR EACH ROW
    SET NEW.applied_date = NOW();

CREATE TRIGGER def_bum_change_date BEFORE INSERT ON bum_change_tb
FOR EACH ROW
    SET NEW.applied_date = NOW();

-- $$North America/South America

/**/

SELECT 'North America/South America' AS Message;

INSERT INTO continent (ENGLISH, RU) VALUES ('NORTH AMERICA','AMÉRICA DEL NORTE');
INSERT INTO continent (ENGLISH, RU) VALUES ('SOUTH AMERICA','AMÉRICA DEL SUR');


SELECT 'DONE';

INSERT INTO bum_change_tb (change_id, script_id) VALUES (1693, 1354);

INSERT INTO bum_script_tb (script_id) VALUES (1354);

UPDATE version_tb SET version_number = 1354;
