summaryrefslogtreecommitdiff
path: root/cli/app/sql/versions
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2021-03-16 16:54:28 +0100
committerJules Laplace <julescarbon@gmail.com>2021-03-16 16:54:28 +0100
commit1cfe96ca6ef5c54eadd986c951dade0f56d72440 (patch)
tree02d34b15a24afa43c6edf7b0011d56bc2c2c49c4 /cli/app/sql/versions
parenta9d86650f40a82a64d1fd8e0525c26422d314d3a (diff)
migrating to mysql
Diffstat (limited to 'cli/app/sql/versions')
-rw-r--r--cli/app/sql/versions/202103161645_add_foreign_key_constraint.py29
1 files changed, 29 insertions, 0 deletions
diff --git a/cli/app/sql/versions/202103161645_add_foreign_key_constraint.py b/cli/app/sql/versions/202103161645_add_foreign_key_constraint.py
new file mode 100644
index 0000000..673f9e4
--- /dev/null
+++ b/cli/app/sql/versions/202103161645_add_foreign_key_constraint.py
@@ -0,0 +1,29 @@
+"""add foreign key constraint
+
+Revision ID: 3f7df6bf63b8
+Revises: 645f315e651d
+Create Date: 2021-03-16 16:45:39.455892
+
+"""
+from alembic import op
+import sqlalchemy as sa
+import sqlalchemy_utc
+
+
+# revision identifiers, used by Alembic.
+revision = '3f7df6bf63b8'
+down_revision = '645f315e651d'
+branch_labels = None
+depends_on = None
+
+
+def upgrade():
+ # ### commands auto generated by Alembic - please adjust! ###
+ op.create_foreign_key(None, 'upload', 'graph', ['graph_id'], ['id'])
+ # ### end Alembic commands ###
+
+
+def downgrade():
+ # ### commands auto generated by Alembic - please adjust! ###
+ op.drop_constraint(None, 'upload', type_='foreignkey')
+ # ### end Alembic commands ###