-
-
Notifications
You must be signed in to change notification settings - Fork 262
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
add "recursive_version_locations = [false|true]" alembic.ini config #760
Comments
multiple directories can be set in the config file by naming them separated by a space with the https://alembic.sqlalchemy.org/en/latest/branches.html#setting-up-multiple-version-directories alembic.ini
when you do this, the "alembic revision" command when asked to create a new file will now require that you also specify --version-path otherwise it won't know where to put the file. in order to make the above scheme dynamic you would need to build a custom front-end that calls into the Alembic commands with a customized config object: https://alembic.sqlalchemy.org/en/latest/api/commands.html |
Thank you very much for the answer. It make sense just wondered if it could be a potential feature to be able to specify an option in the alembic.ini |
where would the file go when one says "alembic revision" ? |
Either just add it to alembic_versions and then people could just move it manually. Or alternatively you could specify |
new files will just go into the folder as they do now. the option indicates to read the directories recursively and that's it. |
ostr00000 has proposed a fix for this issue in the main branch: add recursive_version_locations option for searching revision files https://gerrit.sqlalchemy.org/c/sqlalchemy/alembic/+/4457 |
A better solution for this problem would have been to add support for squashing migrations |
I don't think they are equivalent, especially if also the normal order resolution apply, so each folder is not run in order |
Describe your question
I have an applications where the number of migrations we have done goes past 50. So I would like to organize the migrations into a subfolder system inside the alembic versions. When I try to just move the files into subfolders it does not work out of the box any suggestions on how to do this or is this a feature request?
Example of a folder structure
alembic/versions
└───version_0
│ └───relaease_1
│ │ 439873242343_feature_bla_bla.py
│ │ 43987324fwaer_feature_blu_blu.py
└───version_1
│ └───relaease_2
│ │ 439873243243_feature_bi_foo.py
│ │ 43987324ewraer_feature_we_br.py
The text was updated successfully, but these errors were encountered: