LoginSignup
0
0

More than 1 year has passed since last update.

【Python3】【Flask】flask migrate時にPostgreSQLでのカレントスキーマを指定する。

Posted at

JDBC URLの-cオプションでカレントスキーマを指定する

  • FlaskアプリでPostgreSQLを構築
  • flask migrate, flask upgrade でモデルをDBに反映する際に、publicスキーマにCREATE TABLEされてしまう。
  • JDBC URL のoptionでコマンド実行時セッションのカレントスキーマを変更する。
SQLALCHEMY_DATABASE_URI='postgresql://localhost:5432/test?user=postgres&password=password&options=-c%20search_path=test_schema'

参考:

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