-
Notifications
You must be signed in to change notification settings - Fork 0
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 for Manual Migrations #517
Comments
Changes by Glen Fletcher ():
|
Michael Bayer (zzzeek) wrote: hi there - This is likely not a common use case, since for manual migrations people just log into their database and type ALTER commands. If you want to run op statements in a shell, follow the example at https://alembic.zzzcomputing.com/en/latest/ops.html#alembic.operations.Operations. Here it is in context:
does that solve your issue? |
Changes by Michael Bayer (zzzeek):
|
Glen Fletcher () wrote: Yes Thank you for the help, that covers what I need but I think you misunderstood what I meant by manual, I want to write a system for plugin management where plugins can define database requirements my code would then use the MigrationContext to make necessary changes to the database. I simply mentioned an interactive session as I was sure that would cover what I wanted. I would suggest adding that session of an example of how to run the database operations directory rather than using the automatic version control the tutorial currently covers. I'm sure there are other users who would find an example how how to setup the MigrationContext and Operations manually useful. This allows people to implement their own version control system to meet the requirements of their project. |
Michael Bayer (zzzeek) wrote: you're looking for the API. It's documented, extensively, start at https://alembic.zzzcomputing.com/en/latest/api/index.html. the above session is already described in the "Operation Directives" section. |
Migrated issue, originally created by Glen Fletcher ()
I'm not sure whether this is a problem with the documentation or the code. However I suspect its the documentation that is at fault.
The Documentation, only talks about automatic migration using change scripts, however this isn't always an suitable for a problem.
I would like to see a clearly defined may of manually altering a specific database, lets say I have a Database connection through SQLAlchemy, open on an interactive console. I then want to be able run commands like those used in the change scripts to alter the database. I can't find how to achieve this in the documentation. It should be possible since the framework is effectively doing that but it is designed to work from the migration environment rather than explaining how to open the connection from an interactive session, and setup the state so I can run the requited commands to alter the database.
Such functivity is important for plugin based projects where plugins may require extra columns or tables in the database, it this case there is no linear series of versions, as every instance of the application will have different plugins and therefore different database migrations.
Please update the documentation to cover such usage (and if necessary update the code to provide necessary support)
The text was updated successfully, but these errors were encountered: