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 --with-deletes flag to contao:migrate task #3072

Merged
merged 3 commits into from
Mar 28, 2022

Conversation

qzminski
Copy link
Contributor

  • New feature?

Since Contao 4.13 the contao:migrate performs the automatic database backup task, so I think we should enable --with-deletes flag by default.

/cc @richardhj

@richardhj
Copy link
Contributor

This is a no-go 🙅 in production for me 😊

@qzminski
Copy link
Contributor Author

qzminski commented Mar 26, 2022

Why not? If you'd like to keep the database backups, simply add var/backups directory to the shared dirs. It's incorrect to keep the old and irrelevant structures in your database…

For example, if you remove a package from your app, it should also remove the old database data it used to use, no? Or do you keep the old module data for years? 😉

@Toflar what do you think?

@richardhj
Copy link
Contributor

It happened to me that relevant data was deleted, either because

  • you wrongfully removed an extension and re-install later,
  • you removed a field from the DCA and realized afterward that some part was missing,
  • the Doctrine mapping in Contao was defective thus removing all entity-related data (or MetaModels similar).

Each case happened to me like this or similar.

Deleting data from the database should be opt-in, not opt-out. Even the install tool does not default to deletes. You can overwrite the task :-)

@Toflar
Copy link
Contributor

Toflar commented Mar 28, 2022

Should definitely be opt-out, otherwise it would be the default in the command itself. So 👎 on this as well. Might add a configuration flag for that in order not to require replacing the whole task, though.

@qzminski
Copy link
Contributor Author

I have reverted the recipe command, but added the snippet in the docs. I hope that's a reasonable consensus 🙂

@richardhj
Copy link
Contributor

I feel like that the Contao documentation should be the place for such extensions :)

@antonmedv antonmedv merged commit 0e2f726 into deployphp:master Mar 28, 2022
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

Successfully merging this pull request may close these issues.

None yet

4 participants