Skip to content

Commit

Permalink
wip group membership
Browse files Browse the repository at this point in the history
  • Loading branch information
TLGINO committed Apr 23, 2023
1 parent 594db0e commit 86b1606
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#
# This file is part of Invenio.
# Copyright (C) 2016-2018 CERN.
#
# Invenio is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.

"""Change FK GroupId to string"""

import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "ab7c937cdd3f"
down_revision = "a3f5a8635cbb"
branch_labels = ()
depends_on = "8f11b75e0995"


def upgrade():
"""Upgrade database."""
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index("ix_uq_partial_files_object_is_head", table_name="files_object")
# ### end Alembic commands ###


def downgrade():
"""Downgrade database."""
# ### commands auto generated by Alembic - please adjust! ###
op.create_index(
"ix_uq_partial_files_object_is_head",
"files_object",
["bucket_id", "key"],
unique=False,
)
# ### end Alembic commands ###
2 changes: 1 addition & 1 deletion invenio_communities/members/records/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def user_id(cls):
def group_id(cls):
"""Foreign key to the related group."""
return db.Column(
db.Integer(),
db.String(80),
db.ForeignKey(Role.id, ondelete="RESTRICT"),
nullable=True,
)
Expand Down

0 comments on commit 86b1606

Please sign in to comment.