Repository navigation
fix(sqlite): describeTable now returns unique constraint and references - #12420
Conversation
|
Tests are failing |
|
Other dialects appear to be failing on the new tests that I created. It appears other dialects don't return the |
be3dff4 to
250c74e
Compare
|
Also, should I rebase this branch to target |
ed46562 to
5bceb3f
Compare
|
|
5bceb3f to
3be8877
Compare
|
I'm unsure why the tests are failing now, I tried running the postgres dialect integration tests on the master branch and those aren't successful. I'm unable to run the integration tests for mssql, mysql, and mariadb for some reason. |
|
Oh, nevermind. It looks like just appveyor is failing now. Something to do with uploading code coverage? |
|
I'll start working on preserving foreign keys tomorrow, if I can figure out how that works. |
ae8cef1 to
b5f8711
Compare
|
|
||
| return `${this.createTableQuery(backupTableName, attributes).replace('CREATE TABLE', 'CREATE TEMPORARY TABLE') | ||
| // Temporary tables don't support foreign keys, so creating a temporary table will not allow foreign keys to be preserved | ||
| return `${this.createTableQuery(backupTableName, attributes) |
|
LGTM @dyc3 , ready for merge? |
|
@sushantdhiman Yup! |
|
🎉 This PR is included in version 6.2.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Pull Request check-list
Please make sure to review and check all of these items:
npm run testornpm run test-DIALECTpass with this change (including linting)?Description of change
Fixes #7078
For the sqlite dialect, I added an additional query for describeTable to get the constraints for the columns via showIndexes. I also added a new test for this behavior, and updated existing tests to reflect the new behavior. Currently, this only fixes unique constraints.
I'm intentionally making this a draft until we can fix the foreign key thing because I don't know how those work, and so we can put this fix in v5 as well.
I'm also not really sure if the changes I made to the tests are valid