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
Feature: db.sync() / model.sync() to allow adding as well as dropping columns and indexes. #103
Comments
Columns that are not defined in |
Exactly... glad to hear it's in the plans! |
I'll leave this open to link any progress I do on this. |
+1 on this being a super useful feature. what is the best way to remove a column / change a data type / generally update the schema as is? |
Currently you need to write an ALTER TABLE query and |
Thank you @alyraz . I see a little traction on the plugins side, I'm hoping to make some requested changes and be able to probably create a better sync method in the core or in the plugins. |
+1 |
I'd love to see something like this. I'm currently mulling over how to deal with updating my development database, and it looks like a clean slate is my only real option at the moment... |
I would really love to do this in a different module. @spartan563 @dxg anyone want to start it? :) ORM could provide a database connection and an object with the columns of each table (and indexes). The model just needs to sync it (ALTER, CREATE,.. ). |
I have taken a tentative look at some other migration libraries and it doesn't look too complicated. |
This is in progress right now: |
My co-worker took a more rails like approach which builds on top of It still needs a bit of polishing and extra functionality, but it's well on it's way. |
If sync() could (based on orm setting) do a true sync of the defined model, then db upgrades can be trivial.
There are some things to consider:
These are just thoughts, any feedback, objections?
The text was updated successfully, but these errors were encountered: