Skip to content

svven/database

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Database

Database models and helpers working with SQLAlchemy.

Create (or drop) database

First have an empty database according to configured connection string. Then generate the schema in any of the following ways.

Using plain SQLAlchemy

$ . env/bin/activate
$ python
>>> from database import db
>>> db.create_all() # or db.drop_all()

Using Alembic migrations

$ . env/bin/activate
$ # alembic init migrations # done
$ # alembic revision --autogenerate -m "Initial revision" # done
$ alembic upgrade head

Running migrations

~ Perform any detectable model changes and run

$ . env/bin/activate
$ alembic revision --autogenerate -m "Model change description"
$ alembic upgrade head

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published