pgloader icon indicating copy to clipboard operation
pgloader copied to clipboard

MySQL CHECK constraint not carried over

Open stingray-11 opened this issue 11 months ago • 0 comments

I have the following table. The parent_name_isroot CHECK constraint does not get copied over to postgres. The documentation seems to imply that all constraints are copied over and I can't find an option to specifically include/exclude constraints. Note that primary key and foreign key constraints work fine. This is the syntax I use to create the table in MySQL:

CREATE TABLE a2obj_apps_files_items_item ( id char(16) NOT NULL, parent char(16) DEFAULT NULL, name varchar(255) DEFAULT NULL, isroot tinyint(1) DEFAULT NULL, PRIMARY KEY (id), CONSTRAINT parent_name_isroot CHECK (parent is null and name is null and isroot is not null and isroot = 1 or parent is not null and name is not null and isroot is null) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

stingray-11 avatar Feb 16 '25 18:02 stingray-11