Skip to content
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

MySQL 0000-00-00 to null, but field was not null #143

Open
FreCap opened this issue Apr 27, 2022 · 0 comments
Open

MySQL 0000-00-00 to null, but field was not null #143

FreCap opened this issue Apr 27, 2022 · 0 comments

Comments

@FreCap
Copy link

FreCap commented Apr 27, 2022

MySQL currently allows 0000-00-00 as a valid value, Postgres doesn't and converts it to a null value.

However in case it is converted to null value, and the column in the original MySQL was not null (hence also in postgres is not null), it breaks.

A hack in pg_lib.py can be:

table_ddl = {}
for column in table_metadata:
    # [patch]
    if column["data_type"] in ["timestamp", "date", "datetime"]:
        column["is_nullable"] = "YES"
    # [end patch]

however it would be nice to put it behind a flag and not make it as a default behavior.

Could you please advise how to easily create a new flag for it and use it in that function?

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