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

SqliteSchemaManager::createForeignKey drops the previously added FK #5497

Closed
mvorisek opened this issue Jul 12, 2022 · 2 comments
Closed

SqliteSchemaManager::createForeignKey drops the previously added FK #5497

mvorisek opened this issue Jul 12, 2022 · 2 comments

Comments

@mvorisek
Copy link
Contributor

mvorisek commented Jul 12, 2022

Bug Report

Q A
Version 3.3.7

Summary

AbstractSchemeManager::createForeignKey() method is intended to ADD a new foreign key. If there are already some, they must be kept (or dropped and readded, if platform requires).

Current behaviour

For Sqlite (SqliteSchemaManager), currently, the existing FK is dropped, and after the table is altered, ONLY the new foreign key is present.

How to reproduce

  1. create simple table with 3 integer columns a, b, c
  2. add FK from column b to a
  3. add FK from column c to a
  4. notice, FK from step 3 is created, but FK from step 2 is gone

Expected behaviour

FK is correctly added and all existing FKs retained as for all other DB vendors.

@mvorisek
Copy link
Contributor Author

mvorisek commented Jul 13, 2022

I close this issue, as one source of this issue is SqlitePlatform::supportsForeignKeyConstraints() returning false for DBAL 3.3.x. In DBAL 3.4, I expect this issue be not present.

related PRs #5409 and #5427

@morozov morozov closed this as not planned Won't fix, can't repro, duplicate, stale Jul 15, 2022
@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants