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

migrations:continue should check that DB is initially empty #32

Open
hrach opened this issue Nov 10, 2015 · 3 comments
Open

migrations:continue should check that DB is initially empty #32

hrach opened this issue Nov 10, 2015 · 3 comments
Assignees

Comments

@hrach
Copy link
Member

hrach commented Nov 10, 2015

Currently, if database does not have migrations table and you run migrations:continue, it creates migrations table and runs all your migrations. if your initial migrations isn't created correctly and you are in the middle of project, you can lost your data.

example of initial migrations (which may be an default output of some tools, i.e. Navicat):

DROP TABLE IF EXISTS `acl_acl`;
CREATE TABLE `acl_acl` (
...
)
@JanTvrdik
Copy link
Member

It's intentional – migrations:continue should work the first time as migrations:reset (it simplifies deploy for example). We may consider a requirement that the database must be initially empty.

@hrach
Copy link
Member Author

hrach commented Nov 10, 2015

We may consider a requirement that the database must be initially empty.

Yeah, but that may be quite difficult. Though, I prefer the higher security over the usability.

@JanTvrdik
Copy link
Member

If we ignore triggers, views, procedures and other complicated stuff and check only the count of tables, it should be fine.

@JanTvrdik JanTvrdik changed the title migrations:continue should not create migrations table check that database is initially empty Jan 14, 2016
@JanTvrdik JanTvrdik changed the title check that database is initially empty migrations:continue should check that database is initially empty Jan 14, 2016
@JanTvrdik JanTvrdik changed the title migrations:continue should check that database is initially empty migrations:continue should check that DB is initially empty Jan 14, 2016
@JanTvrdik JanTvrdik self-assigned this Jan 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants