
USE parts;

SELECT CONCAT('WARNING: Table ', TABLE_SCHEMA, '.', TABLE_NAME, ' already exists.') AS msg_warning 
FROM INFORMATION_SCHEMA.TABLES 
WHERE 
        TABLE_SCHEMA = 'parts' 
    AND TABLE_NAME = 'DOG_Dog_Change_Set'
;

CREATE TABLE IF NOT EXISTS parts.DOG_Dog_Change_Set (
	  id_change_set INT NOT NULL AUTO_INCREMENT PRIMARY KEY
	, comment VARCHAR(500)
	, updated_last_on DATETIME
    , id_user_updated_last_by INT
    , CONSTRAINT FK_DOG_Role_id_user_updated_last_by
        FOREIGN KEY (id_user_updated_last_by)
        REFERENCES parts.DOG_User(id_user)
);