-
Notifications
You must be signed in to change notification settings - Fork 157
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
Bug/schema naming #184
Bug/schema naming #184
Conversation
Updates _getSchema() and _updateSchema() to use a new _getSchemaClassName() method, which merges existing behavior for plugins with a new default for base Cake applications. Most importantly, `Config/Schema/schema.php` files will now be generated using `AppSchema` as the default class name instead of `APP_DIR . 'Schema'`.
The unit tests in this area don't cover every case. (They didn't even before this PR.) This could use some more field testing. |
I have confirmed locally that
|
Sigh. Do not merge. There's an issue here. The SchemaShell has two possible arguments: Specifying both EDIT: This is the reason why: https://github.com/cakephp/cakephp/blob/92957913d93404d8554345d4e41cb3c723a0a842/lib/Cake/Console/Command/SchemaShell.php#L74,L76 You can't tell the SchemaShell that you explicitly want the default file name in spite of the This relates to cakephp/cakephp#4174. |
So there is no way to resolve this properly until this gets fixed in the core. Can you please show this issue to Mark Story to get it fixed? |
Correct. I'll do a PR to fix the SchemaShell this week.
|
Great! 👍 |
The SchemaShell has two possible arguments: `--name` and `--file`. If you only specify `--name` (as this PR does), then the `--file` param is automatically set to match. This means you''ll end up with a `Config/Schema/app.php` file instead of `Config/Schema/schema.php as expected. This PR should be safe to apply once cakephp/cakephp#4230 is merged and available in a production release of the core.
I submitted a PR for the SchemaShell fixes that are required for the MigrationShell to work properly. We'll have to wait on this PR until that fix has made its way into a Cake core release. |
Yes, I've just seen that. Good job on that! The question for me is now how to deal with that change in the migrations plugin, we need to provide some BC compatibility in the case this change will break something. |
My PR checks for both All new Schema files will be written with |
As I said before, more testing couldn't hurt though since the unit tests themselves were a little short in this area to begin with (it's kinda hard to test, in fairness.) |
cakephp/cakephp#4230 has been merged, but we still need to wait for a public release before my changes here will be effective. The SchemaShell fix should be included in 2.5.4 based on 4230's Milestone setting. |
Thanks for your work on this @beporter! I set this to hold and will merge it when there is a new release of CakePHP. I'm just not sure yet if we should wait for 2.6 or already do it for 2.5.4. |
Thanks! |
😄 |
Add a LICENSE file and do some cleanup
Proposed fix for #131.
Adds an option for specifying the Schema class name on the command line.
Updates
_getSchema()
and_updateSchema()
to use a new_getSchemaClassName()
method, which merges existing behavior for plugins with a new default for base Cake applications.Most importantly,
Config/Schema/schema.php
files will now be generated usingAppSchema
as the default class name instead ofAPP_DIR . 'Schema'
.Thanks to @burzum for the initial attempt at resolving this.