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

Issue #196: Add the 'name' to the 'reference' block for FOREIGN KEY constraints #224

Merged
merged 2 commits into from
Jan 7, 2024

Conversation

cfhowes
Copy link
Contributor

@cfhowes cfhowes commented Jan 6, 2024

As requested in #196, added name to the references block of constraints. This should allow users of the parsed output to be able to associate the FOREIGN KEY with the proper column in the table.

@@ -960,8 +967,6 @@ def set_constraint(
target_dict["constraints"] = {}
if not target_dict["constraints"].get(_type):
target_dict["constraints"][_type] = []
if "name" in constraint:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't know why these were here, but they were breaking my references. Removing them did not break any other tests, so i think that maybe they were unnecessary?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

possible, it is redunant code, looks like I changed some logic, but forgot to remove this

@@ -644,7 +644,9 @@ def test_double_single_quotes():

def test_autoincrement_order():
# test for https://github.com/xnuinside/simple-ddl-parser/issues/208
ddl = """CREATE TABLE table (surrogatekey_SK NUMBER(38,0) NOT NULL autoincrement start 1 increment 1 ORDER COMMENT 'Record Identification Number Ordered')"""
ddl = """CREATE TABLE table (
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

they changes in this file are all from the pre-commit hook.

@xnuinside
Copy link
Owner

@cfhowes thanks for the PR again ! :)

@xnuinside xnuinside merged commit abe2a57 into xnuinside:main Jan 7, 2024
8 checks passed
@xnuinside
Copy link
Owner

@cfhowes changes released in version 0.32.0

@cfhowes cfhowes deleted the issue_196_fk_name branch January 8, 2024 16:11
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

Successfully merging this pull request may close these issues.

2 participants