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
Diff Feature: Why is require-table enabled? #232
Comments
I agree, it should probably default to the same as the rest of the commands. I was surprised by this feature yesterday when doing the workshops |
The main reason it is forced is because of tables that could be created from plugins. It can become an option, that would be fine with me. It will be inline with baking a snapshot. I can add the option and remove the hardcoded value if you would rather have the same behavior 😄 |
Giving this more thought, it should be known that when migrating or rolling back, when the dump is created it will add all tables found in the dump file. Unless I'm over thinking the problem with plugins tables... But that is something that could happen. |
These are good points, I didn't think of the rollback scenario. Still, usually if we talk about a dump we mean the whole database. I don't think you're overthinking this, but also I'm not sure if there's an easy solution here. |
I understand that sometimes tables are created from plugins... but I still think it is a better default to follow the rest of the commands and not require the table classes to be present. |
I tried this feature today to find that many tables in my database where part of the diff. This does not make any sense as my initial migration file already contains all these tables (created via Consider doing this:
The current situation is that |
@ypnos-web It actually should not be. However, I'm curious to see the files in question to try to shed some light on this. |
I had run a
The result is the same: the Tester migration creates all tables without classes in Which files in particular are you interested in? Here are the dump file and the Tester migration. |
@ypnos-web I need to understand your setup a bit more. I need :
And what did you do ? Bake a snapshot ? And after that, you just baked a diff ? Basically, I need to know your setup and each step you did so I can reproduce the issue and know if that comes from the require-table option. |
Here is a full table list:
All tables marked with * also have a table class. And I already checked for you that these are exactly the tables not present in the Tester migration. The What I did was, bake an initial migration snapshot, bake and apply a few migrations on top of it (affecting (In case you are wondering, most of these tables are legacy from a previous Cake2 app and the parts of the app corresponding to them had not been ported yet. Only a few tables without classes are actually used by the app) |
@ypnos-web Strike that one, I was able to reproduce the behavior you are experiencing on my Linux system. |
I opened PR #248. This PR sets the require-table option to false and should solve the questions raised in this ticket. |
Hi,
first off thanks for the diff feature - this fits our workflow perfectly.
One thing I stumbled upon while playing with it was that the
schema-dump-default.lock
contains just tables with have an ORM Table object in theApp\Model\Table
namespace.This happens because in
Migrations\Command\Dump::execute()
therequire-table
param is hardcoded totrue
.Is there a reason for this?
Thanks
The text was updated successfully, but these errors were encountered: