Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/conode/application/interfaces/repositories/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from .context import ContextRepository
from .contract import ContractRepository
from .edge import EdgeRepository
from .grant import CompanyGrantRepository, UserGrantRepository
from .grant import UserGrantRepository
from .group import GroupRepository
from .node import NodeAssociationRepository, NodeRepository
from .offer import (
Expand All @@ -16,7 +16,6 @@
from .user import UserRepository

__all__ = (
"CompanyGrantRepository",
"CompanyRepository",
"ContextRepository",
"ContractRepository",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
from .company import CompanyGrantRepository
from .user import UserGrantRepository

__all__ = (
"CompanyGrantRepository",
"UserGrantRepository",
)
__all__ = ("UserGrantRepository",)

This file was deleted.

3 changes: 0 additions & 3 deletions src/conode/domain/grant/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
from .company import CompanyGrant, CompanyGrantId
from .user import UserGrant, UserGrantId

__all__ = (
"CompanyGrant",
"CompanyGrantId",
"UserGrant",
"UserGrantId",
)
32 changes: 0 additions & 32 deletions src/conode/domain/grant/company.py

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
"""remove-company-grant

Revision ID: 4574d0b1f6b0
Revises: a3029168e306
Create Date: 2026-08-10 10:37:40.356818

"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision: str = '4574d0b1f6b0'
down_revision: Union[str, Sequence[str], None] = 'a3029168e306'
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None


def upgrade() -> None:
"""Upgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('company_grant_record')
# ### end Alembic commands ###


def downgrade() -> None:
"""Downgrade schema."""
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('company_grant_record',
sa.Column('id', sa.UUID(), autoincrement=False, nullable=False),
sa.Column('role_id', sa.UUID(), autoincrement=False, nullable=False),
sa.Column('company_id', sa.UUID(), autoincrement=False, nullable=False),
sa.Column('created_at', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=False),
sa.Column('updated_at', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=False),
sa.ForeignKeyConstraint(['company_id'], ['company_record.id'], name=op.f('company_grant_record_company_id_fkey'), ondelete='CASCADE'),
sa.ForeignKeyConstraint(['role_id'], ['role_record.id'], name=op.f('company_grant_record_role_id_fkey'), ondelete='CASCADE'),
sa.PrimaryKeyConstraint('id', name=op.f('company_grant_record_pkey'))
)
# ### end Alembic commands ###
21 changes: 1 addition & 20 deletions src/conode/infrastructure/persistence/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from conode.domain.context import Context
from conode.domain.contract import Contract, ContractStatus
from conode.domain.edge import Edge
from conode.domain.grant import CompanyGrant, UserGrant
from conode.domain.grant import UserGrant
from conode.domain.group import Group
from conode.domain.node import Node, NodeAssociation
from conode.domain.offer import (
Expand Down Expand Up @@ -232,24 +232,6 @@
Column("updated_at", DateTime(timezone=True), nullable=False),
)

company_grant_record_table = Table(
"company_grant_record",
metadata,
Column("id", UUID, primary_key=True, nullable=False),
Column(
"role_id",
ForeignKey("role_record.id", ondelete="CASCADE"),
nullable=False,
),
Column(
"company_id",
ForeignKey("company_record.id", ondelete="CASCADE"),
nullable=False,
),
Column("created_at", DateTime(timezone=True), nullable=False),
Column("updated_at", DateTime(timezone=True), nullable=False),
)

offer_link_record_table = Table(
"offer_link_record",
metadata,
Expand Down Expand Up @@ -386,7 +368,6 @@ def start_mapper() -> None:
registry_mapper.map_imperatively(Context, context_record_table)
registry_mapper.map_imperatively(Role, role_record_table)
registry_mapper.map_imperatively(UserGrant, user_grant_record_table)
registry_mapper.map_imperatively(CompanyGrant, company_grant_record_table)
registry_mapper.map_imperatively(RolePermission, permission_record_table)
registry_mapper.map_imperatively(
Edge,
Expand Down
Loading