Skip to content

MySQL CHECK constraint not carried over #1645

Open
@stingray-11

Description

@stingray-11

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;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions