-
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add function for min_compatible_version
- fix alembic setup environment - add min_compatible_version increase version length - update model to match database - add edit form for firmware view - add get_catalog filter based on min_compatible_version
- Loading branch information
Showing
7 changed files
with
67 additions
and
10 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[alembic] | ||
script_location = . | ||
script_location = ./migrations | ||
|
||
[loggers] | ||
keys = root,sqlalchemy,alembic | ||
|
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
37 changes: 37 additions & 0 deletions
37
migrations/versions/426e7f8fe7c6_increase_version_length_and_add_min_.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,37 @@ | ||
"""Increase version length and add min_compatible_version | ||
Revision ID: 426e7f8fe7c6 | ||
Revises: 76d559b4e873 | ||
Create Date: 2024-01-09 09:56:56.088816 | ||
""" | ||
revision = "426e7f8fe7c6" | ||
down_revision = "76d559b4e873" | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
|
||
def upgrade(): | ||
op.add_column( | ||
"firmware", | ||
sa.Column("min_compatible_version", sa.Unicode(length=10), nullable=True), | ||
) | ||
op.alter_column( | ||
"firmware", | ||
"version", | ||
existing_type=sa.VARCHAR(length=3), | ||
type_=sa.Unicode(length=10), | ||
existing_nullable=False, | ||
) | ||
|
||
|
||
def downgrade(): | ||
op.alter_column( | ||
"firmware", | ||
"version", | ||
existing_type=sa.Unicode(length=10), | ||
type_=sa.VARCHAR(length=3), | ||
existing_nullable=False, | ||
) | ||
op.drop_column("firmware", "min_compatible_version") |
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
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