Make chat_backend migrations a single chain.
0034_waitlistentry and 0034_customuser_use_conversation_context both depended on 0033, so the graph had two leaves. Waitlist is now 0035 and depends on the customuser migration. Closes #76
This commit is contained in:
1 parent
257890e600
commit
b47da073f9
2 files changed
+15
-1
No files matched your search
+1
-1
@@ -7,7 +7,7 @@ from django.db import migrations, models
|
|||||||
class Migration(migrations.Migration):
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
("chat_backend", "0033_agentrun_agentstep"),
|
("chat_backend", "0034_customuser_use_conversation_context"),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
from django.db import connection
|
||||||
|
from django.db.migrations.loader import MigrationLoader
|
||||||
|
from django.test import TestCase
|
||||||
|
|
||||||
|
|
||||||
|
class MigrationGraphTests(TestCase):
|
||||||
|
def test_chat_backend_has_a_single_leaf(self):
|
||||||
|
loader = MigrationLoader(connection, ignore_no_migrations=True)
|
||||||
|
leaves = [name for app, name in loader.graph.leaf_nodes() if app == "chat_backend"]
|
||||||
|
self.assertEqual(leaves, ["0035_waitlistentry"])
|
||||||
|
|
||||||
|
node = loader.graph.nodes[("chat_backend", "0035_waitlistentry")]
|
||||||
|
parents = [name for app, name in node.dependencies if app == "chat_backend"]
|
||||||
|
self.assertEqual(parents, ["0034_customuser_use_conversation_context"])
|
||||||
Reference in new issue
Block a user