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

Support namespaces in migration files. #213

Closed
1 of 3 tasks
markstory opened this issue Apr 7, 2016 · 6 comments
Closed
1 of 3 tasks

Support namespaces in migration files. #213

markstory opened this issue Apr 7, 2016 · 6 comments
Milestone

Comments

@markstory
Copy link
Member

From @thinkingmedia on April 7, 2016 13:8

This is a (multiple allowed):

  • bug
  • enhancement
  • feature-discussion (RFC)
  • CakePHP Version: 3.2.6
  • Platform and Target: Apache2, MySQL, PHP 7

What you did

  • Create an app and bake a migration file called CreateImages.
  • Create a plugin and bake a migration file called CreateImages.

Expected Behavior

The classes CreateImages are unrelated to each other.

Actual Behavior

PhpStorm warns that the class CreateImages is already defined for the project. Since the migration classes do not use a namespace they exist in the same global space.

Is this a limitation imposed by Phinx?

Copied from original issue: cakephp/cakephp#8603

@markstory
Copy link
Member Author

From @dereuromark on April 7, 2016 13:16

If this is a limitation maybe we should always prefix with the plugin or vendor name then?

@markstory
Copy link
Member Author

From @thinkingmedia on April 7, 2016 13:34

I would prefix only plugins but that's a good idea.

@markstory
Copy link
Member Author

From @HavokInspiration on April 7, 2016 17:12

Right now, migrations can not live under a namespace.
See #139 and cakephp/phinx#168

So currently, only prefixing the migration classname as @dereuromark suggested would work.

@HavokInspiration HavokInspiration added this to the 1.6.3 milestone Jun 16, 2016
@HavokInspiration HavokInspiration modified the milestones: 1.6.3, 1.6.4 Jul 1, 2016
@HavokInspiration HavokInspiration modified the milestones: 1.6.4, 1.6.5 Dec 8, 2016
@HavokInspiration HavokInspiration modified the milestones: 1.6.5, 1.6.6, 1.6.7 Dec 30, 2016
@HavokInspiration HavokInspiration modified the milestones: 1.6.7, 1.6.8 Jan 8, 2017
@HavokInspiration HavokInspiration modified the milestones: 1.6.8, 1.7.1 Aug 2, 2017
@HavokInspiration HavokInspiration modified the milestones: 1.7.1, 1.7.2 Aug 5, 2017
@dereuromark
Copy link
Member

dereuromark commented Dec 16, 2017

👍 for namespaces and alike. I ran into the same issue now a few times with too short names and thus colliding with basic classes of the app.

So it would be good if all migration files would be namespaced as supported by phinx.

@thinkingmedia
Copy link

In addition to namespaces. I wish we could file migrations under subfolders where a folder presented a major version. I have been struggling with a large number of migration files that I don't want to throw away as I sometimes build from scratch on my dev machine, but after working on this project for several years. A single folder approach shows the a lack of scalability.

@dereuromark
Copy link
Member

We first need to fix up Phinx here in cakephp/phinx#168

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

4 participants