mirror of
https://github.com/zulip/zulip.git
synced 2025-11-02 21:13:36 +00:00
45 lines
2.0 KiB
Python
45 lines
2.0 KiB
Python
# Generated by Django 1.11.23 on 2019-08-23 21:03
|
|
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
|
("zerver", "0239_usermessage_copy_id_to_bigint_id"),
|
|
]
|
|
|
|
operations = [
|
|
migrations.RunSQL(
|
|
"""
|
|
DROP TRIGGER zerver_usermessage_bigint_id_to_id_trigger ON zerver_usermessage;
|
|
DROP FUNCTION zerver_usermessage_bigint_id_to_id_trigger_function();
|
|
|
|
ALTER TABLE zerver_usermessage ALTER COLUMN bigint_id SET NOT NULL;
|
|
ALTER TABLE zerver_usermessage DROP CONSTRAINT zerver_usermessage_pkey;
|
|
DROP SEQUENCE zerver_usermessage_id_seq CASCADE;
|
|
ALTER TABLE zerver_usermessage RENAME COLUMN id to id_old;
|
|
ALTER TABLE zerver_usermessage RENAME COLUMN bigint_id to id;
|
|
ALTER TABLE zerver_usermessage ADD CONSTRAINT zerver_usermessage_pkey PRIMARY KEY USING INDEX zerver_usermessage_bigint_id_idx;
|
|
CREATE SEQUENCE zerver_usermessage_id_seq;
|
|
SELECT SETVAL('zerver_usermessage_id_seq', (SELECT MAX(id)+1 FROM zerver_usermessage));
|
|
ALTER TABLE zerver_usermessage ALTER COLUMN id SET DEFAULT NEXTVAL('zerver_usermessage_id_seq');
|
|
ALTER TABLE zerver_usermessage ALTER COLUMN id_old DROP NOT NULL;
|
|
""",
|
|
state_operations=[
|
|
# This just tells Django to understand executing the above SQL as if it just ran the operations below,
|
|
# so that it knows these model changes are handled and doesn't to generate them on its own
|
|
# in the future makemigration calls.
|
|
migrations.RemoveField(
|
|
model_name="usermessage",
|
|
name="bigint_id",
|
|
),
|
|
migrations.AlterField(
|
|
model_name="usermessage",
|
|
name="id",
|
|
field=models.BigAutoField(primary_key=True, serialize=False),
|
|
),
|
|
],
|
|
),
|
|
]
|