File tree Expand file tree Collapse file tree
src/dstack/_internal/server Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ """Added email index
2+
3+ Revision ID: 1aa9638ad963
4+ Revises: 22d74df9897e
5+ Create Date: 2025-12-21 22:08:27.331645
6+
7+ """
8+
9+ from alembic import op
10+
11+ # revision identifiers, used by Alembic.
12+ revision = "1aa9638ad963"
13+ down_revision = "22d74df9897e"
14+ branch_labels = None
15+ depends_on = None
16+
17+
18+ def upgrade () -> None :
19+ # ### commands auto generated by Alembic - please adjust! ###
20+ with op .batch_alter_table ("users" , schema = None ) as batch_op :
21+ batch_op .create_index (batch_op .f ("ix_users_email" ), ["email" ], unique = False )
22+
23+ # ### end Alembic commands ###
24+
25+
26+ def downgrade () -> None :
27+ # ### commands auto generated by Alembic - please adjust! ###
28+ with op .batch_alter_table ("users" , schema = None ) as batch_op :
29+ batch_op .drop_index (batch_op .f ("ix_users_email" ))
30+
31+ # ### end Alembic commands ###
Original file line number Diff line number Diff line change @@ -201,7 +201,7 @@ class UserModel(BaseModel):
201201 ssh_private_key : Mapped [Optional [str ]] = mapped_column (Text , nullable = True )
202202 ssh_public_key : Mapped [Optional [str ]] = mapped_column (Text , nullable = True )
203203
204- email : Mapped [Optional [str ]] = mapped_column (String (200 ), nullable = True )
204+ email : Mapped [Optional [str ]] = mapped_column (String (200 ), nullable = True , index = True )
205205
206206 projects_quota : Mapped [int ] = mapped_column (
207207 Integer , default = settings .USER_PROJECT_DEFAULT_QUOTA
You can’t perform that action at this time.
0 commit comments