-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
improve migrate command #384
Comments
Migrations from custom locations are already supported. |
I think the main enhancement here is about applying migration from modules:
I think this is worth doing. We mainly need to support array for |
What about extensions? |
It doesn't have to be modules actually. It is essentially a collection of named migration paths. Perhaps we should rename the option. The tricky part is how to "automatically register" a migration path. This is something we should think more. It is related with the process of installing an extension. This is easy if all extensions are installed via composer. |
I'll handle this. |
I was able to configure the migrations in a
But that would get overwritten by other modules doing the same, I guess. Could we add an |
I don't think DI container should support this. There are two cases here:
|
What do you mean with internally developed modules, like subfolders in |
I mean modules you develop within your application. These modules are not extensions. |
I'd like to be able to configure them how I need them. Eg. I often use |
Let's consolidate the discussion of this thread and #3273. Here's how I envision it from the global picture:
|
So having migrations and translation in extras sounds nice, not sure if it has to be wrapped in
This information should be written to
Which would get merged with the values from
|
To avoid confusion, I think we should make it generic by using "extra": {
"bootstrap": "schmunk42\\playground\\Bootstrap",
"params": {
"yii.migrations": ["@schmunk42/playground/migrations"],
"yii.messages": ["@schmunk42/playground/messages"]
}
} These parameters can be automatically merged into |
Alright, but let's use Are there any other parts of the application which already rely on a specific |
I think we should use For core components, right now we only need migration paths and translation paths. This feature opens the possibility for non-core extensions to require similar kind of global parameters. Yes, @yiisoft/core-developers any comments on this feature? |
hi, as I don't have an opinion on how to implement - after you decided, can u pls. make an short example on how to use it, as this is what I'm currently looking forward too;) Thanks! |
@qiangxue I'm confused. Are we talking about migrations or general way to allow components to affect overall application behavior? |
@samdark The discussion emerged from the migrations feature, since we need a way to register migrations (and other stuff) in the application. The |
@samdark We are talking about a general way of letting a service to gather information that could be provided by different components. Migration and translation are two most obvious examples. For migration, the command needs to gather a list of migration paths that could be specified by installed extensions or modules developed within an app. For translation, We do not want to place these extensions or modules in the bootstrapping process for performance reason. So I'm suggesting to use |
You mean extension will write something to params on installing it? |
I'll leave this post here to not create the same one. |
@vladim1 Check out our extension https://github.com/dmstr/yii2-migrate-command |
I think #8202 is a good way to fix this issue for modules, extensions, external libraries and all the other cases discused here. |
Since I include migrations in my test routines - ie migrations should be able to migrate all the way down and all the way up at any time - I am looking forward to a built-in solution. 👍 |
I whould solve this matter using namespaces instead of paths, just I have proposed here: |
@klimov-paul We're currently using aliases, which is essentially the same, isn't it? #384 (comment) |
I discovered this issue before two years. Well the eta was RC. Any chance that this feature will be implemented in the next release or should we stick to some extensions that can handle this approach? |
Solution proposed at #12511 |
Resolved by commit 8aa0e85 |
more or less like this one from @cebe https://github.com/yiiext/migrate-command
The text was updated successfully, but these errors were encountered: