-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path2837c7c54f35_initial_schema.py
41 lines (33 loc) · 1.37 KB
/
2837c7c54f35_initial_schema.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"""Initial schema
Revision ID: 2837c7c54f35
Revises:
Create Date: 2024-10-31 11:27:32.242586
"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
# revision identifiers, used by Alembic.
revision = '2837c7c54f35'
down_revision = None
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('project',
sa.Column('name', sqlmodel.sql.sqltypes.AutoString(), nullable=False),
sa.Column('description', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
sa.Column('cluster_queue', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
sa.Column('local_queue', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
sa.Column('namespace', sqlmodel.sql.sqltypes.AutoString(), nullable=True),
sa.Column('id', sa.Uuid(), nullable=False),
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_project_description'), 'project', ['description'], unique=False)
op.create_index(op.f('ix_project_name'), 'project', ['name'], unique=True)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_project_name'), table_name='project')
op.drop_index(op.f('ix_project_description'), table_name='project')
op.drop_table('project')
# ### end Alembic commands ###