Skip to content

Commit

Permalink
remove uniqueness of name in project and organization
Browse files Browse the repository at this point in the history
  • Loading branch information
habibasseiss committed Nov 26, 2024
1 parent bf384f0 commit 2be212f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
4 changes: 2 additions & 2 deletions app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Organization:
id: Mapped[uuid.UUID] = mapped_column(
init=False, primary_key=True, default_factory=uuid.uuid4
)
name: Mapped[str] = mapped_column(unique=True)
name: Mapped[str] = mapped_column()
created_at: Mapped[datetime] = mapped_column(
init=False, server_default=func.now()
)
Expand Down Expand Up @@ -86,7 +86,7 @@ class Project:
id: Mapped[uuid.UUID] = mapped_column(
init=False, primary_key=True, default_factory=uuid.uuid4
)
name: Mapped[str] = mapped_column(unique=True)
name: Mapped[str] = mapped_column()
description: Mapped[str]
created_at: Mapped[datetime] = mapped_column(
init=False, server_default=func.now()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa

from alembic import op

# revision identifiers, used by Alembic.
revision: str = '4127ed6f6cf2'
Expand All @@ -24,8 +23,7 @@ def upgrade() -> None:
sa.Column('id', sa.Uuid(), nullable=False),
sa.Column('name', sa.String(), nullable=False),
sa.Column('created_at', sa.DateTime(), server_default=sa.text('now()'), nullable=False),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('name')
sa.PrimaryKeyConstraint('id')
)
op.create_table('organization_user',
sa.Column('organization_id', sa.Uuid(), nullable=False),
Expand All @@ -41,8 +39,7 @@ def upgrade() -> None:
sa.Column('created_at', sa.DateTime(), server_default=sa.text('now()'), nullable=False),
sa.Column('organization_id', sa.Uuid(), nullable=False),
sa.ForeignKeyConstraint(['organization_id'], ['organizations.id'], ),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('name')
sa.PrimaryKeyConstraint('id')
)
# ### end Alembic commands ###

Expand Down

0 comments on commit 2be212f

Please sign in to comment.