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
@Check constraint breaks schema generator #4505
Comments
I am not able to reproduce this, please provide a complete repro, ideally as a script (using schema generator programmatically). The stack trace is from creating the schema, so it needs to origin in the |
Let's reopen with a failing repro, closing as not reproducible for now. |
@B4nan I am also running into this issue with 5.7.12, but noticed that it only occurs when cache is present. Deleting the cache folder eliminates the issue. I will attempt to create a failing repo, but hopefully this one tidbit helps steer in the right direction in the meantime. I also did some debugging and noticed that it seems metadata is generated properly, but somewhere down the line when TableCompiler_MySQL.toSQL (within the knex package) is called, the Check expression function provided is undefined. |
@B4nan I have a failing representation of the issue here: Run |
Thanks, got it reproduced, its indeed about the metadata cache. |
The problem is actually the callback signature, as that is not properly serialized to the JSON. |
@B4nan when you say the callback signature is not properly serialized, is that an issue with the serializer or with how one writes a Check expression? |
Describe the bug
SchemaGenerator (CLI or called programmatically) fails on subsequent runs when a check constraint is placed on a column.
Stack trace
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Schema should drop/build successfully each time with the check constraints in place
Additional context
This feels similar to #4312 in behavior, but the stack trace is quite different.
Versions
The text was updated successfully, but these errors were encountered: