... on 操作の中で、 schema_editor.connection.alias 属性を見て、データベース接続のエイリアスを確認します: from django.db import migrations def forwards ( apps , schema_editor ): if schema_editor . connection . alias != "default" : return # Your migration code g ... oes here class Migration ( migrations . Migration ): dependencies = [ # Dependencies to other migrations ] operations = [ migrations . RunPython ( forwards ), ] ... turn db == hints [ "target_db" ] return True これをマイグレーションに利用するには、次のようにします: from django.db import migrations def forwards ( apps , schema_editor ): # Your migration code goes here ... class Migration ( migrations . Migration ): dep ... ... on 操作の中で、 schema_editor.connection.alias 属性を見て、データベース接続のエイリアスを確認します: from django.db import migrations def forwards ( apps , schema_editor ): if schema_editor . connection . alias != "default" : return # Your migration code g ... oes here class Migration ( migrations . Migration ): dependencies = [ # Dependencies to other migrations ] operations = [ migrations . RunPython ( forwards ), ] ... turn db == hints [ "target_db" ] return True これをマイグレーションに利用するには、次のようにします: from django.db import migrations def forwards ( apps , schema_editor ): # Your migration code goes here ... class Migration ( migrations . Migration ): dep ... ... うコマンドを、いくつか挙げておきましょう。 migrate は、マイグレーションを適用したり、適用をキャンセルするのに使います。 makemigrations は、モデルに対して行った変更をもとに、新しいマイグレーションを作成します。 sqlmigrate は、マイグレーションに対応する SQL 文 ... を表示します。 showmigrations は、プロジェクトのマイグレーションとそのステータスをリストします。 マイグレーションというのは、データベーススキーマに対する ... バージョン管理システムのようなものです。 makemigrations はモデルの変更点を1つのマイグレーションファイルにパッケージングし(コミットのようなものです)、 migrate はその変更点をデータ ... ... うコマンドを、いくつか挙げておきましょう。 migrate は、マイグレーションを適用したり、適用をキャンセルするのに使います。 makemigrations は、モデルに対して行った変更をもとに、新しいマイグレーションを作成します。 sqlmigrate は、マイグレーションに対応する SQL 文 ... を表示します。 showmigrations は、プロジェクトのマイグレーションとそのステータスをリストします。 マイグレーションというのは、データベーススキーマに対する ... バージョン管理システムのようなものです。 makemigrations はモデルの変更点を1つのマイグレーションファイルにパッケージングし(コミットのようなものです)、 migrate はその変更点をデータ ... ... more helpful error message if you try to migrate an app without first creating the contenttypes table ( #22411 ). Modified migrations dependency algorithm to avoid possible infinite recursion. Fixed a UnicodeDecodeError when the flush error message contain ... ed Unicode characters ( #22882 ). Reinstated missing CHECK SQL clauses which were omitted on some backends when not using migrations ( #23416 ). Fixed serialization of type objects in migrations ( #22951 ). Allowed inline and hidden references to admin fi ... during application loading ( #22920 ). Empty index_together or unique_together model options no longer results in infinite migrations ( #23452 ). Fixed crash in contrib.sitemaps if lastmod returned a date rather than a datetime ( #23403 ). Allowed migratio ... ... more helpful error message if you try to migrate an app without first creating the contenttypes table ( #22411 ). Modified migrations dependency algorithm to avoid possible infinite recursion. Fixed a UnicodeDecodeError when the flush error message contain ... ed Unicode characters ( #22882 ). Reinstated missing CHECK SQL clauses which were omitted on some backends when not using migrations ( #23416 ). Fixed serialization of type objects in migrations ( #22951 ). Allowed inline and hidden references to admin fi ... during application loading ( #22920 ). Empty index_together or unique_together model options no longer results in infinite migrations ( #23452 ). Fixed crash in contrib.sitemaps if lastmod returned a date rather than a datetime ( #23403 ). Allowed migratio ... ... ( #23717 ). Added GeoDjango compatibility with mysqlclient database driver. Fixed MySQL 5.6+ crash with GeometryField s in migrations ( #23719 ). Fixed a migration crash when removing a field that is referenced in AlterIndexTogether or AlterUniqueTogether ... ld s with blank=True on PostGIS ( #23731 ). Allowed usage of DateTimeField() as Transform.output_field ( #23420 ). Fixed a migration serializing bug involving float("nan") and float("inf") ( #23770 ). Fixed a regression where custom form fields having a qu ... None ( #23761 ). Fixed a migration crash when a field is renamed that is part of an index_together ( #23859 ). Fixed squashmigrations to respect the --no-optimize parameter ( #23799 ). Made RenameModel reversible ( #22248 ) Avoided unnecessary rollbacks of ... ... ( #23717 ). Added GeoDjango compatibility with mysqlclient database driver. Fixed MySQL 5.6+ crash with GeometryField s in migrations ( #23719 ). Fixed a migration crash when removing a field that is referenced in AlterIndexTogether or AlterUniqueTogether ... ld s with blank=True on PostGIS ( #23731 ). Allowed usage of DateTimeField() as Transform.output_field ( #23420 ). Fixed a migration serializing bug involving float("nan") and float("inf") ( #23770 ). Fixed a regression where custom form fields having a qu ... None ( #23761 ). Fixed a migration crash when a field is renamed that is part of an index_together ( #23859 ). Fixed squashmigrations to respect the --no-optimize parameter ( #23799 ). Made RenameModel reversible ( #22248 ) Avoided unnecessary rollbacks of ... ... field that is both a foreign and primary key ( #24951 ). Fixed AssertionError in some complex queries ( #24525 ). Fixed a migrations crash with GenericForeignKey ( #25040 ). Made translation.override() clear the overridden language when a translation isn' ... ion for options of non- argparse management commands ( #25372 ). Alphabetized ordering of imports in from django.db import migrations, models statement in newly created migrations ( #25384 ). Fixed migrations crash on MySQL when adding a text or a blob fie ... 正 前のトピックへ Django 1.8.6 リリースノート 次のトピックへ Django 1.8.4 リリースノート 関連キーワード Fixed model queries migrations crash Made AssertionError foreign translation using list reverse values autocommit many リリースノート October fixes sever ... ... field that is both a foreign and primary key ( #24951 ). Fixed AssertionError in some complex queries ( #24525 ). Fixed a migrations crash with GenericForeignKey ( #25040 ). Made translation.override() clear the overridden language when a translation isn' ... ion for options of non- argparse management commands ( #25372 ). Alphabetized ordering of imports in from django.db import migrations, models statement in newly created migrations ( #25384 ). Fixed migrations crash on MySQL when adding a text or a blob fie ... 正 前のトピックへ Django 1.8.6 リリースノート 次のトピックへ Django 1.8.4 リリースノート 関連キーワード Fixed model queries migrations Django field crash Made AssertionError foreign translation using list reverse values autocommit set many リリースノート Oc ... 2026年10月08日