0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

sqlalchemyメモ

Posted at

設定ファイルを環境変数に設定する

export FLASK_CONFIG_FILE=./local.cfg 

model変更をもとにrevisionファイル生成する

python manage.py db migrate

revisionファイルを持ってデータベースを更新する

python manage.py db upgrade

手動で編集するrevisionファイル作成する場合

python manage.py db revision

upgrade, downgradeのないrevisionファイルを作られる

現在のrevison情報を表示する; revison履歴を表示する

python manage.py db show 
python manage.py db history

全revisionのsql scriptsを生成する

python manage.py db upgrade --sql > ../sql/`date "+%y%m%d%H%M"`.sql
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?