-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ dist/ | |
tests/generator/_models.py | ||
./models.py | ||
poetry.lock | ||
*~ |
Original file line number | Diff line number | Diff line 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 commentThe 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. ;) |
||
Jinja2 = "^3.0.1" | ||
py-models-parser = "^0.7.0" | ||
pydantic = "^1.8.2" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,6 @@ def test_mssql_brackets_removed(): | |
""" | ||
result = create_models(ddl) | ||
expected = """from gino import Gino | ||
from sqlalchemy.dialects.postgresql import ARRAY | ||
|
||
db = Gino(schema="dbo") | ||
|
||
|
@@ -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 commentThe 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. |
||
request_drop_date = db.Column(smalldatetime()) | ||
shift_class = db.Column(db.String(5)) | ||
start_history = db.Column(datetime2(7), nullable=False) | ||
|
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.