-
Notifications
You must be signed in to change notification settings - Fork 34
Adding new field to class during project #9
Comments
At the moment, migration isn't automated. I have been a little busy the last few months. I have a few days off now, so I can probably fix it before Saturday, if that would suffice? |
It's perfect thanks :) |
I am spending my Easter deep in the Norwegian mountains, and I seem to have lost my internet connection (writing this on my phone). I'm afraid it will be a little delayed. As SQLite's ALTER TABLE only supports adding columns and renaming tables, I'm not sure how I want to implement it at the moment. If you need it asap, or you want to contribute, you are welcome to give it a try and send a pull request! :) |
ok for the delay, i will wait a little. |
If automatic migration is added, I think it should at least support adding and removing columns. This isn't possible using SQLites alter table. I understand. Best of luck with your project :) |
Its true, removing is not support by sqlite. Since its a sqlite problem, people will understand that the field they just delete from class won't be delete from table (even if they don't use swiftydb, the problem will be the same). |
FYI: you can perform any alteration you want to an SQLite table, including removing columns: https://www.sqlite.org/lang_altertable.html#otheralter |
Yes, that would be the naïve, and probably the best approach. As I didn't have a chance to work on this during the Easter due to connection problems, and I am quite busy until May. I'll push a new version as soon as possible |
The implementation is mostly done, but it needs to be tested |
https://www.techonthenet.com/sqlite/tables/alter_table.php this will help you |
Hello,
When adding a new field to my class, it seams to not be create into database. If i try to make a print of that new field, it display error "fatal error: unexpectedly found nil while unwrapping an Optional value"
The text was updated successfully, but these errors were encountered: