-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #607 from nkaretnikov/role-mappings-api-491
Change API to be able to assign roles to namespaces
- Loading branch information
Showing
12 changed files
with
1,061 additions
and
40 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
conda-store-server/conda_store_server/alembic/versions/771180018e1b_add_v2_role_mappings.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
"""add v2 role mappings | ||
Revision ID: 771180018e1b | ||
Revises: 30b37e725c32 | ||
Create Date: 2023-11-29 09:02:35.835664 | ||
""" | ||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "771180018e1b" | ||
down_revision = "30b37e725c32" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.create_table( | ||
"namespace_role_mapping_v2", | ||
sa.Column("id", sa.Integer(), nullable=False), | ||
sa.Column("namespace_id", sa.Integer(), nullable=False), | ||
sa.Column("other_namespace_id", sa.Integer(), nullable=False), | ||
sa.Column("role", sa.Unicode(length=255), nullable=False), | ||
sa.ForeignKeyConstraint( | ||
["namespace_id"], | ||
["namespace.id"], | ||
), | ||
sa.ForeignKeyConstraint( | ||
["other_namespace_id"], | ||
["namespace.id"], | ||
), | ||
sa.PrimaryKeyConstraint("id"), | ||
sa.UniqueConstraint("namespace_id", "other_namespace_id", name="_uc"), | ||
) | ||
|
||
|
||
def downgrade(): | ||
op.drop_table("namespace_role_mapping_v2") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.