-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
fix bugs for testing with Redshift (include a new feature; add columun with UNIQUE) #134
Conversation
shimizukawa
commented
Jul 15, 2024
•
edited
Loading
edited
- FAILED: test_inspectdb; inspectdb should suppress output 'id = AutoField(primary_key=True)'
- FAILED: test_alter_size
- FAILED: test_alter_size_for_unique
FAILED: test_alter_sizeE django.db.utils.NotSupportedError: cannot decrease a VARCHAR column size with default value inspectionto be fixed
|
FAILED: test_alter_size_for_uniqueE django.db.utils.NotSupportedError: ALTER TABLE ADD COLUMN does not support columns defined with UNIQUE or PRIMARY KEY constraints inspectionWhile sequentially checking the SQL issued by the test code, I encountered an error when adding a column with a UNIQUE constraint. =# CREATE TABLE foo (id INTEGER);
=# ALTER TABLE "foo" ADD COLUMN "name" varchar(20) UNIQUE;
ERROR: ALTER TABLE ADD COLUMN does not support columns defined with UNIQUE or PRIMARY KEY constraints Therefore, while the previously implemented "resizing columns with a UNIQUE constraint" is functioning, the test code that uses "adding a column with a UNIQUE constraint" encountered an error. I did not notice this issue during CI because the validation was performed using Postgres instead of Redshift. The SQL execution log is summarized in the comment at the following link: To be fixedI have now implemented support for "adding a column with a UNIQUE constraint." |
… AutoField(primary_key=True)'
… not accept ADD COLUMN with UNIQUE, so we neet adding column without UNIQUE then add UNIQUE CONSTRAINT.
…se the size of a column that have default.
d3c6bb4
to
d85f51b
Compare
… AutoField(primary_key=True)'
…NIQUE then add UNIQUE CONSTRAINT. This change also fixes test_alter_size_for_unique with redshift.
…se the size of a column that have default.
d85f51b
to
2a108f5
Compare