PS : I use mysql to live app
Apr 16, 2020
5
Level 3
Phpunit + SQLite General error: 1 Cannot add a NOT NULL column with default value NULL
i've this error when i try my test. but working when the application is live.
Level 14
@djomobil This might just be SQLite being a little picky. I just tried this out in a fresh laravel project and get the exact same error running tests.
What I assuming goes wrong is that SQLite will not agree to do an ALTER TABLE where you add a column which is either not nullable or has no default value, this might be some protection in regards to a table already having data and in that case, it would not know what to do.
You have 3 solutions:
- Add your column and constraint to the
create_domains_tablemigration - Make
registrar_idnullable - Give
registrar_ida default value
Please or to participate in this conversation.