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

Add a test for sqlite schema tool #11079

Closed
wants to merge 1 commit into from

Conversation

franmomu
Copy link
Contributor

@franmomu franmomu commented Nov 20, 2023

I was trying to reproduce the bug found in doctrine/data-fixtures#452, so in 3.x should fail.

In 3.0.x this is the output:

CREATE TABLE readers.user (id INTEGER NOT NULL, PRIMARY KEY(id))
CREATE TABLE readers.author_reader (author_id INTEGER NOT NULL, reader_id INTEGER NOT NULL, PRIMARY KEY(author_id, reader_id), CONSTRAINT FK_3155D2E5F675F31B FOREIGN KEY (author_id) REFERENCES readers.user (id) NOT DEFERRABLE INITIALLY IMMEDIATE, CONSTRAINT FK_3155D2E51717D737 FOREIGN KEY (reader_id) REFERENCES readers.user (id) NOT DEFERRABLE INITIALLY IMMEDIATE)
CREATE INDEX IDX_3155D2E5F675F31B ON readers.author_reader (author_id)
CREATE INDEX IDX_3155D2E51717D737 ON readers.author_reader (reader_id)

Update: Related to #9259 so I guess this can be closed

self::assertEquals('CREATE INDEX IDX_83C36113F675F31B ON readers__author_reader (author_id)', $sql[2]);
self::assertEquals('CREATE INDEX IDX_83C361131717D737 ON readers__author_reader (reader_id)', $sql[3]);

self::assertCount(4, $sql);
Copy link
Member

Choose a reason for hiding this comment

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

Please move this up before the other asserts.

@franmomu
Copy link
Contributor Author

thanks @SenseException for the review, but I guess this can be closed since it was fixed in dbal

@franmomu franmomu closed this Nov 24, 2023
@franmomu franmomu deleted the add_test_sqlite_schema branch November 24, 2023 08:28
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