https://github.com/colanconnon/apistar_alembic_migrations
Alembic migrations for apistar
https://github.com/colanconnon/apistar_alembic_migrations
alembic apistar migrations python python3
Last synced: 6 months ago
JSON representation
Alembic migrations for apistar
- Host: GitHub
- URL: https://github.com/colanconnon/apistar_alembic_migrations
- Owner: colanconnon
- Created: 2017-09-25T00:16:26.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T00:40:14.000Z (almost 3 years ago)
- Last Synced: 2025-04-14T19:56:58.247Z (6 months ago)
- Topics: alembic, apistar, migrations, python, python3
- Language: Python
- Homepage:
- Size: 43.9 KB
- Stars: 18
- Watchers: 1
- Forks: 2
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Alembic migrations for apistar
### To Install this library
```
pip3 install apistar_alembic_migrations
```### Register the commands
```
from apistar_alembic_migrations import commandsapp = App(
routes=routes,
settings=settings,
commands=commands,
components=sqlalchemy_backend.components
)
```### To generation the initial migrations structure
```
apistar initialize
```### The following commands will become avaiable
```
apistar initializeapistar create_revision "message"
apistar upgrade <"revision id" or Head for latest>
apistar downgrade "revision id"
```
### Enabling auto generating of migrations from models
* open your env.py file in your migrations folder
* find the line that contains
```
target_metadata = None
```* Import your Declartive Base variable and assign the metadata
```
from app import Base
target_metadata = Base.metadata
```