Skip to content

Commit 01ec775

Browse files
committed
probably working reply_to constraint migration, but doesn't work on sqlite3
1 parent efa34fa commit 01ec775

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Generated by Django 4.1.3 on 2023-02-08 12:55
2+
3+
from django.db import migrations
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
("chats", "0002_directchatmessage_is_deleted_and_more"),
10+
]
11+
12+
operations = [
13+
# migrations.RunSQL(
14+
# sql="""
15+
# ALTER TABLE chats_directchatmessage
16+
# ADD CONSTRAINT my_constraint
17+
# CHECK (
18+
# (chats_directchatmessage.reply_to_id IS NULL) OR
19+
# (chats_directchatmessage.chat_id = (SELECT chats_directchatmessage.chat_id FROM chats_directchatmessage WHERE chats_directchatmessage.id = chats_directchatmessage.reply_to_id))
20+
# )
21+
# """,
22+
# reverse_sql="""
23+
# ALTER TABLE chats_directchatmessage
24+
# DROP CONSTRAINT my_constraint
25+
# """)
26+
]
27+

0 commit comments

Comments
 (0)