From c78bd0b9ea626f35c566fb760ae937c975fb3d5a Mon Sep 17 00:00:00 2001 From: Karolina Przerwa Date: Wed, 14 Jun 2023 10:19:55 +0200 Subject: [PATCH] alembic: fix syntax issue for mysql --- .../842a62b56e60_change_fk_accountsrole_to_string_downgrade.py | 1 + .../f9843093f686_change_fk_accountsrole_to_string_upgrade.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/invenio_access/alembic/842a62b56e60_change_fk_accountsrole_to_string_downgrade.py b/invenio_access/alembic/842a62b56e60_change_fk_accountsrole_to_string_downgrade.py index 8118f3f..6eb8d6c 100644 --- a/invenio_access/alembic/842a62b56e60_change_fk_accountsrole_to_string_downgrade.py +++ b/invenio_access/alembic/842a62b56e60_change_fk_accountsrole_to_string_downgrade.py @@ -29,6 +29,7 @@ def downgrade(): existing_type=sa.String(80), type_=sa.Integer, postgresql_using="role_id::integer", + nullable=False, ) op.create_foreign_key( op.f("fk_access_actionsroles_role_id_accounts_role"), diff --git a/invenio_access/alembic/f9843093f686_change_fk_accountsrole_to_string_upgrade.py b/invenio_access/alembic/f9843093f686_change_fk_accountsrole_to_string_upgrade.py index 336e808..10ddf5f 100644 --- a/invenio_access/alembic/f9843093f686_change_fk_accountsrole_to_string_upgrade.py +++ b/invenio_access/alembic/f9843093f686_change_fk_accountsrole_to_string_upgrade.py @@ -34,6 +34,7 @@ def upgrade(): existing_type=sa.Integer, type_=sa.String(80), postgresql_using="role_id::integer", + nullable=False, ) op.create_foreign_key( op.f("fk_access_actionsroles_role_id_accounts_role"), @@ -41,7 +42,7 @@ def upgrade(): "accounts_role", ["role_id"], ["id"], - ondelete="CASCADE", + ondelete="CASCADE" )