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
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"""Added email index

Revision ID: 1aa9638ad963
Revises: 22d74df9897e
Create Date: 2025-12-21 22:08:27.331645

"""

from alembic import op

# revision identifiers, used by Alembic.
revision = "1aa9638ad963"
down_revision = "22d74df9897e"
branch_labels = None
depends_on = None


def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("users", schema=None) as batch_op:
batch_op.create_index(batch_op.f("ix_users_email"), ["email"], unique=False)

# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table("users", schema=None) as batch_op:
batch_op.drop_index(batch_op.f("ix_users_email"))

# ### end Alembic commands ###
2 changes: 1 addition & 1 deletion src/dstack/_internal/server/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ class UserModel(BaseModel):
ssh_private_key: Mapped[Optional[str]] = mapped_column(Text, nullable=True)
ssh_public_key: Mapped[Optional[str]] = mapped_column(Text, nullable=True)

email: Mapped[Optional[str]] = mapped_column(String(200), nullable=True)
email: Mapped[Optional[str]] = mapped_column(String(200), nullable=True, index=True)

projects_quota: Mapped[int] = mapped_column(
Integer, default=settings.USER_PROJECT_DEFAULT_QUOTA
Expand Down