... 接続してクエリ CREATE EXTENSION IF NOT EXISTS hstore; を実行してください。 CreateExtension ¶ class CreateExtension ( name , hints = None ) [ソース] ¶ PostgreSQL拡張モジュールをインストールする Operation サブクラスです。一般的な拡張モジュールについては、 ... 以下のサブクラスのいずれかを使用してください。 name ¶ これは必須の引数です。インストールする拡張機能の名前です。 hints ¶ New in Django 6.0. The optional hints argument will be passed as **hints to the allow_migrate() method of database route ... rs to assist them in making routing decisions . BloomExtension ¶ class BloomExtension ( hints = None ) [ソース] ¶ bloom 拡張機能をインストールします。 hints ¶ New in Django 6.0. The optional hints argument will be pa ... ... 接続してクエリ CREATE EXTENSION IF NOT EXISTS hstore; を実行してください。 CreateExtension ¶ class CreateExtension ( name , hints = None ) [ソース] ¶ PostgreSQL拡張モジュールをインストールする Operation サブクラスです。一般的な拡張モジュールについては、 ... 以下のサブクラスのいずれかを使用してください。 name ¶ これは必須の引数です。インストールする拡張機能の名前です。 hints ¶ New in Django 6.0. The optional hints argument will be passed as **hints to the allow_migrate() method of database route ... rs to assist them in making routing decisions . BloomExtension ¶ class BloomExtension ( hints = None ) [ソース] ¶ bloom 拡張機能をインストールします。 hints ¶ New in Django 6.0. The optional hints argument will be pa ... ... ます。 データベース ルーター ¶ データベース ルーターは、以下の 4 つのメソッドを提供するクラスです: db_for_read ( model , ** hints ) ¶ model 型のオブジェクトの読み取り操作に使用するデータベースをサジェストします。 データベース操作がデータベースを選択する ... 際に役立つ追加情報を提供できる場合、それは hints 辞書で与えられます。有効なヒントの詳細は 下記 を参照してください。 サジェストがない場合は None を返します。 db_for_write ( ... model , ** hints ) ¶ Model型のオブジェクトの書き込みに使用するデータベースをサジェストします。 データベース操作がデータベースを選択する際に ... ... ます。 データベース ルーター ¶ データベース ルーターは、以下の 4 つのメソッドを提供するクラスです: db_for_read ( model , ** hints ) ¶ model 型のオブジェクトの読み取り操作に使用するデータベースをサジェストします。 データベース操作がデータベースを選択する ... 際に役立つ追加情報を提供できる場合、それは hints 辞書で与えられます。有効なヒントの詳細は 下記 を参照してください。 サジェストがない場合は None を返します。 db_for_write ( ... model , ** hints ) ¶ Model型のオブジェクトの書き込みに使用するデータベースをサジェストします。 データベース操作がデータベースを選択する際に ... ... encies = [ # Dependencies to other migrations ] operations = [ migrations . RunPython ( forwards ), ] You can also provide hints that will be passed to the allow_migrate() method of database routers as **hints : myapp/dbrouters.py ¶ class MyRouter : d ... ef allow_migrate ( self , db , app_label , model_name = None , ** hints ): if "target_db" in hints : return db == hints [ "target_db" ] return True これをマイグレーションに利用するには、次のよう ... ns . Migration ): dependencies = [ # Dependencies to other migrations ] operations = [ migrations . RunPython ( forwards , hints = { "target_db" : "default" }), ] もし RunPython や RunSQL 操作が 1 つのモデルにしか影響しないのであれば、 model_name をヒ ... ... encies = [ # Dependencies to other migrations ] operations = [ migrations . RunPython ( forwards ), ] You can also provide hints that will be passed to the allow_migrate() method of database routers as **hints : myapp/dbrouters.py ¶ class MyRouter : d ... ef allow_migrate ( self , db , app_label , model_name = None , ** hints ): if "target_db" in hints : return db == hints [ "target_db" ] return True これをマイグレーションに利用するには、次のよう ... ns . Migration ): dependencies = [ # Dependencies to other migrations ] operations = [ migrations . RunPython ( forwards , hints = { "target_db" : "default" }), ] もし RunPython や RunSQL 操作が 1 つのモデルにしか影響しないのであれば、 model_name をヒ ... ... raint に置き換えます。 特別なオペレーション ¶ RunSQL ¶ class RunSQL ( sql , reverse_sql = None , state_operations = None , hints = None , elidable = False ) [ソース] ¶ データベース上で任意の SQL を実行できるようにします。Django が直接サポートしていない ... operations = [ migrations . AddField ( "musician" , "name" , models . CharField ( max_length = 255 ), ), ], ) オプションの hints 引数はデータベースルータオブジェクトの allow_migrate() メソッドに **hints として渡されてルーティングの決定を補助します。デ ... れは特に処理を逆の順序で行いたい場合に有用です。 RunPython ¶ class RunPython ( code , reverse_code = None , atomic = None , hints = None , elidable = False ) [ソース] ¶ マイグレーション履歴を反映して独自の Python コードを実行します。 code (与えられれば ... ... raint に置き換えます。 特別なオペレーション ¶ RunSQL ¶ class RunSQL ( sql , reverse_sql = None , state_operations = None , hints = None , elidable = False ) [ソース] ¶ データベース上で任意の SQL を実行できるようにします。Django が直接サポートしていない ... operations = [ migrations . AddField ( "musician" , "name" , models . CharField ( max_length = 255 ), ), ], ) オプションの hints 引数はデータベースルータオブジェクトの allow_migrate() メソッドに **hints として渡されてルーティングの決定を補助します。デ ... れは特に処理を逆の順序で行いたい場合に有用です。 RunPython ¶ class RunPython ( code , reverse_code = None , atomic = None , hints = None , elidable = False ) [ソース] ¶ マイグレーション履歴を反映して独自の Python コードを実行します。 code (与えられれば ... ... tension , CryptoExtension , HStoreExtension , TrigramExtension , and UnaccentExtension operations now support the optional hints parameter. This allows providing database hints to database routers to assist them in making routing decisions . django.co ... ... tension , CryptoExtension , HStoreExtension , TrigramExtension , and UnaccentExtension operations now support the optional hints parameter. This allows providing database hints to database routers to assist them in making routing decisions . django.co ... 2026年10月08日