Make the author field nullable #117
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "davidoskky/ReaderForSelfoss-multiplatform:author"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Types of changes
The author field is nullable, these changes will handle it and prevent crashes.
@ -1 +1 @@
ALTER TABLE ITEM ADD COLUMN `author` TEXT NOT NULL;
ALTER TABLE ITEM ADD COLUMN `author` TEXT;
You can´t update a sqldelight migration file. You have to create a new file
2.sq
and add the sql query changing the column inside.Ops, I thought this version hadn't been released yet and that thus that would be fine.
I just saw that you can't update a column type in sqlite.
You'll have to rename the existing one create a new one with the old name and the right type, and then drop the old one.(not possible in older versions of android because it's only available since version 3.25.0 of sqlite, and Android has old versions)You'll have to drop the old column, and recreate it.
Will you be able to do these changes today ? This seem to cause issues for multiple users.
Yes, I'll submit everything soon.
Can you please change the migration to a simpler one ?
@ -0,0 +1,6 @@
CREATE TABLE ITEM_BACKUP AS SELECT `id`, `datetime`, `title`, `content`,
This is unnecessary.
The data will be updated if needed with the update of
updateItem
you made.Droping the column and recreating it should by enough.
Dropping columns was introduced in version 3.35 https://sqlite.org/changes.html
Alright, this should now work; I'm not able to test the migration because the previous version crashes on me, check that everything works smoothly.
I had to drop the whole table since also renaming columns is a new feature.
I just realized that migrations aren't run automatically, son the first one wasn't done. I'll merge this and make a small change so it would work as expected.