X Tutup
The Wayback Machine - https://web.archive.org/web/20201011185231/https://github.com/JSQLParser/JSqlParser/issues/985
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

Support Foreign Key ON UPDATE CASCADE #985

Closed
dprutean opened this issue May 16, 2020 · 2 comments
Closed

Support Foreign Key ON UPDATE CASCADE #985

dprutean opened this issue May 16, 2020 · 2 comments

Comments

@dprutean
Copy link

@dprutean dprutean commented May 16, 2020

Two more statements to check ( ON UPDATE [RESTRICT | CASCADE | SET NULL | NO ACTION | SET DEFAULT})

ALTER TABLE texto
ADD CONSTRAINT texto_autor_id_foreign FOREIGN KEY (autor_id) REFERENCES users (id) ON UPDATE CASCADE,
ADD CONSTRAINT texto_tipotexto_id_foreign FOREIGN KEY (tipotexto_id) REFERENCES tipotexto (id) ON UPDATE CASCADE

Encountered unexpected token: "UPDATE" "UPDATE"
at line 2, column 97.

ALTER TABLE texto_fichero
ADD CONSTRAINT texto_fichero_fichero_id_foreign FOREIGN KEY (fichero_id) REFERENCES fichero (id) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT texto_fichero_texto_id_foreign FOREIGN KEY (texto_id) REFERENCES texto (id) ON DELETE CASCADE ON UPDATE CASCADE

Encountered unexpected token: "ON" "ON"
at line 2, column 126.

@wumpz
Copy link
Member

@wumpz wumpz commented May 16, 2020

JSqlParser supports only ON DELETE (at the moment). Pull requests are welcome.

gitmotte added a commit to gitmotte/JSqlParser that referenced this issue Jul 26, 2020
gitmotte added a commit to gitmotte/JSqlParser that referenced this issue Jul 26, 2020
gitmotte added a commit to gitmotte/JSqlParser that referenced this issue Jul 26, 2020
gitmotte added a commit to gitmotte/JSqlParser that referenced this issue Jul 26, 2020
* add more unittest-assertions
JSQLParser#985
gitmotte added a commit to gitmotte/JSqlParser that referenced this issue Jul 29, 2020
gitmotte added a commit to gitmotte/JSqlParser that referenced this issue Jul 30, 2020
wumpz pushed a commit that referenced this issue Aug 9, 2020
* #985

* add 2 unit-tests for given statements
#985

* fix formating (line width)
#985

* * fix nullpointerexceptions
* add more unittest-assertions
#985

* change order to match the same order as in ForeignKeyIndex

* byAction should not throw an exception (is used by deprecated
string-setters)

* add unit-tests for ReferentialAction within AlterExpression

* fix toString (added bug on refactoring)

* javadoc

* test set from get on null-values too

* refactoring: add and use ReferentialAction() to evaluate enum

#985

* refactoring: fix parser that order of referential actions does not
matter

#985

* add empty constructor
@gitmotte
Copy link
Contributor

@gitmotte gitmotte commented Aug 17, 2020

@wumpz this is merged already an can be closed.

@wumpz wumpz closed this Aug 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.
X Tutup