Skip to content

Commit ac14193

Browse files
feat: db migration
1 parent 2f2c1f7 commit ac14193

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
"""add_short_name_to_biocommons_group
2+
3+
Revision ID: 30fd168b9c90
4+
Revises: ff6e32a9c164
5+
Create Date: 2025-10-14 11:23:53.350674
6+
7+
"""
8+
from typing import Sequence, Union
9+
10+
from alembic import op
11+
import sqlalchemy as sa
12+
import sqlmodel
13+
14+
15+
# revision identifiers, used by Alembic.
16+
revision: str = '30fd168b9c90'
17+
down_revision: Union[str, None] = 'ff6e32a9c164'
18+
branch_labels: Union[str, Sequence[str], None] = None
19+
depends_on: Union[str, Sequence[str], None] = None
20+
21+
22+
def upgrade() -> None:
23+
# ### commands auto generated by Alembic - please adjust! ###
24+
op.add_column('biocommonsgroup', sa.Column('short_name', sqlmodel.sql.sqltypes.AutoString(), nullable=False))
25+
op.create_unique_constraint(op.f('uq_biocommonsgroup_short_name'), 'biocommonsgroup', ['short_name'])
26+
# ### end Alembic commands ###
27+
28+
29+
def downgrade() -> None:
30+
# ### commands auto generated by Alembic - please adjust! ###
31+
op.drop_constraint(op.f('uq_biocommonsgroup_short_name'), 'biocommonsgroup', type_='unique')
32+
op.drop_column('biocommonsgroup', 'short_name')
33+
# ### end Alembic commands ###

0 commit comments

Comments
 (0)