-
Notifications
You must be signed in to change notification settings - Fork 21
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
Foreign Key processing updates #55
Conversation
@@ -21,9 +22,11 @@ def get_tables_information( | |||
"contains ddl or ddl_file that contains path to ddl file to parse" | |||
) | |||
if ddl: | |||
tables = DDLParser(ddl).run(group_by_type=True) | |||
tables = DDLParser(ddl, normalize_names=True).run(group_by_type=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this feels like a good change to me - i think i would want my output code to have normalized names. I was having problems with my foreign keys until i put this setting in, but i'll figure out where that went wrong if you don't like this change.
@@ -24,7 +24,7 @@ classifiers = [ | |||
|
|||
[tool.poetry.dependencies] | |||
python = ">=3.7,<4.0" | |||
simple-ddl-parser = "^0.28" | |||
simple-ddl-parser = "^1.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i hope this is OK. All the changes i submitted to simple-ddl-parser were to make this work for my DDL. ;)
@@ -50,7 +49,7 @@ class UsersWorkSchedule(db.Model): | |||
|
|||
__tablename__ = 'users_WorkSchedule' | |||
|
|||
id = db.Column(ARRAY((1,1)), primary_key=True) | |||
id = db.Column(db.Integer(), primary_key=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking at the code above, I think this was actually a bug in the test/parsing from before. with the updated simple-ddl-parser version the parsing bug has been fixed and so the test updated. please let me know if i interpreted that incorrectly.
@cfhowes thanks for opening the PR, I will check little bit later |
@cfhowes released in version 0.15.1, thank you one more time! |
I was having some problems with how FOREIGN KEYs were being handled for both keys listed after the COLUMN statements (rather then inline in the statement) and for those with compound keys.
If thinks look reasonable, I'll update the changelog as well.