Skip to content
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

Add change() method to migrations #3

Open
samdark opened this issue Mar 31, 2015 · 10 comments
Open

Add change() method to migrations #3

samdark opened this issue Mar 31, 2015 · 10 comments

Comments

@samdark
Copy link
Member

samdark commented Mar 31, 2015

The idea is to implement the same code as in up() and determine how to roll back migration based on it. Migration in this case should be like a query and a builder that has two modes: up and down.

It already exists in some third party libs such as https://phinx.org/

@pana1990
Copy link

@v0lume
Copy link

v0lume commented Aug 6, 2015

cool! like it!

@SonicGD
Copy link

SonicGD commented Aug 7, 2015

👍

@ghost
Copy link

ghost commented Aug 7, 2015

👍 :)

@RedCatGirl
Copy link

👍

@samdark
Copy link
Member Author

samdark commented Sep 10, 2015

#593

@execut
Copy link
Contributor

execut commented Feb 13, 2017

👍 This idea is to reduce the cost of migration in 2 or more times. I know it by own experience.
My implementation of this idea in yii2 extension: https://github.com/execut/yii2-migration

@samdark
Copy link
Member Author

samdark commented Jul 20, 2017

Phinx docs about that: http://docs.phinx.org/en/latest/migrations.html

@sergeymakinen
Copy link
Member

I'd like to make it real later. ;)

@SamMousa
Copy link

I'm not a fan of creating reversible migrations that contain createTable or addColumn.
They might be reversible from a structure perspective, but they lose data.
Of course, if we implemented automated backups of those tables then i'm all for it!

@samdark samdark transferred this issue from yiisoft/yii2 Nov 3, 2018
@samdark samdark transferred this issue from yiisoft/db Apr 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants