-
Notifications
You must be signed in to change notification settings - Fork 517
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(db): noise settings migration (#1352)
* fix:(db) noise settings migration * fix(db): set character limit to 2000 for sqlite
- Loading branch information
Showing
4 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
app/db/migrations/versions/2ea33513efc0_noise_for_sqlite.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
"""noise for sqlite | ||
Revision ID: 2ea33513efc0 | ||
Revises: a9cfd5611a82 | ||
Create Date: 2024-10-11 15:36:32.096594 | ||
""" | ||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
# revision identifiers, used by Alembic. | ||
revision = '2ea33513efc0' | ||
down_revision = 'a9cfd5611a82' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
bind = op.get_bind() | ||
|
||
if bind.engine.name == 'sqlite': | ||
with op.batch_alter_table('hosts') as batch_op: | ||
batch_op.alter_column('noise_setting', | ||
existing_type=sa.String(length=2000), | ||
nullable=True) | ||
|
||
|
||
def downgrade() -> None: | ||
# ### commands auto generated by Alembic - please adjust! ### | ||
pass | ||
# ### end Alembic commands ### |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters