-
-
Notifications
You must be signed in to change notification settings - Fork 215
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
[3.0.0-alpha1] Allow migrations_paths to contain config file-relative paths #312
Comments
Probably a nicer way would be allowing something as the |
Migration classes don't have to be stored inside the bundle, they can be anywhere within a Composer package, if coming from Issue is complicated further if you wish to run migrations from within the Composer package (e.g. on CI), where you don't have a Symfony app and just run the migrations manually. Allowing paths relative to the configuration would help in both of these cases. |
As I know no symfony bundle implements "config file relative paths".... regarding the doctrine/migrations library, the paths are already relative to the config file... |
The paths are relative to the Finder class: protected function getRealPath(string $directory) : string
{
$dir = realpath($directory);
if ($dir === false || ! is_dir($dir)) {
throw InvalidDirectory::new($directory);
}
return $dir;
} Tracing it all back to |
The requested behavior would be that passing in a relative path should instead use the root where the config file is stored. So if my config is located in |
I have just tested my config file with using The config file is at
when running |
@9ae8sdf76 I think that you are confusing the bundle configurations and the library one. The library configuration is relative to the configuration file, the bundle is relative to the symfony working dir |
This is both a bug report and/or a feature request for the 3.0 alpha version of this bundle:
Allow defining relative paths to the migrations folder so that it can be referenced from within bundles. It seems the most common use case is to use
%kernel.root_path%/migrations
, but from within a bundle that path would not work. It would be useful to be able to define a path similar to'../../Migrations'
(relative to a config file defined in the bundle) to use as a migrations path.If there is a better way to define bundle-specific migrations paths - without modifying the main application - I'm open to suggestion.
The text was updated successfully, but these errors were encountered: