Parcourir la source

push alembic migration

tripeur il y a 1 an
Parent
commit
db69d7af4b

+ 38 - 0
alembic/versions/2024083136_update_sms_volunteer_link_466d86d3edac.py

@@ -0,0 +1,38 @@
+"""update sms<=>volunteer link
+
+Revision ID: 466d86d3edac
+Revises: f058df5a266c
+Create Date: 2024-08-31 14:36:54.062147
+
+"""
+from alembic import op
+import sqlalchemy as sa
+
+
+# revision identifiers, used by Alembic.
+revision = "466d86d3edac"
+down_revision = "f058df5a266c"
+branch_labels = None
+depends_on = None
+
+
+def upgrade():
+    # ### commands auto generated by Alembic - please adjust! ###
+    op.drop_constraint("sms_volunteer_id_fkey", "sms", type_="foreignkey")
+    op.create_foreign_key(
+        "sms_volunteer_id_fkey_2",
+        "sms",
+        "volunteers",
+        ["volunteer_id"],
+        ["id"],
+        onupdate="CASCADE",
+        ondelete="CASCADE",
+    )
+    # ### end Alembic commands ###
+
+
+def downgrade():
+    # ### commands auto generated by Alembic - please adjust! ###
+    op.drop_constraint("sms_volunteer_id_fkey_2", "sms", type_="foreignkey")
+    op.create_foreign_key("sms_volunteer_id_fkey", "sms", "volunteers", ["volunteer_id"], ["id"])
+    # ### end Alembic commands ###