-
create a PostgreSQL database name:
my-style
-
pip install -r requirements.txt
- if you're getting an error on Mac OS X for Psycopy2 install the binary using:
pip install psycopg2-binary
- if you're getting an error on Mac OS X for Psycopy2 install the binary using:
-
create a
./.env
file containing:export APP_SETTINGS="config.DevelopmentConfig"
-
Model def:
-
model_id = db.Column(db.Integer, ForeignKey('table_name.column_name'))
-
modelProperty = relationship( 'ClassName of ForeignModel', secondary='join_table_name', back_populates='correspondingForeignModelProperty')
-
time stamp to look at
-
-
lock in new dependencies:
pip freeze > requirements.txt
-
Start local env:
source env/bin/activate
-
End local env:
deactivate
-
quick SQLAlchemy ref
-
start the db
sudo systemctl start postgresql.service
-
stop the db
sudo systemctl stop postgresql.service
- Create the database in terminal under postgres user:
sudo -iu postgres
under manjaro linux From primiary user: python manage.py db initi
sets up the Alembic first timemanage.py
is the setup file locationpython manage.py db migrate
pulls migrations from all model deffinitionspython manage.py db upgrade
updates the database from all migrations