Skip to content

MySQL CHECK constraint not carried over #1645

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
stingray-11 opened this issue Feb 16, 2025 · 0 comments
Open

MySQL CHECK constraint not carried over #1645

stingray-11 opened this issue Feb 16, 2025 · 0 comments

Comments

@stingray-11
Copy link

stingray-11 commented Feb 16, 2025

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;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant