You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
This problem affects sqlite DB, tested on MySQL and it was fine.
When adding a foreign key to existing table, the table is dropped and created again with incorrect NOT NULL setting on column. If there is no foreign key, standard ALTER is used and this issue won't happen.
To Reproduce
Setup sqlite database
Create migration with nullable column
Create another migration, add new nullable column to the table created before, reference some foreign key
Migrate
The original column is now NOT NULL
Expected behavior
Table should be recreated as was defined before, NULL column should not change to NOT NULL.
Describe the bug
This problem affects sqlite DB, tested on MySQL and it was fine.
When adding a foreign key to existing table, the table is dropped and created again with incorrect NOT NULL setting on column. If there is no foreign key, standard ALTER is used and this issue won't happen.
To Reproduce
Expected behavior
Table should be recreated as was defined before, NULL column should not change to NOT NULL.
Screenshots or code snippets
Migration:
Notice that the title column should be nullable ("NULL"). The SQL code generated by this migration is:
The title column is now recreated as NOT NULL, which is incorrect behaviour.
Desktop (please complete the following information):
What database are you using?
The text was updated successfully, but these errors were encountered: