40 lines
1.1 KiB
Python
40 lines
1.1 KiB
Python
"""Add backup config columns to system_settings table.
|
|
|
|
Follow-up to 0130: the backup feature (10b1f83) added backup_interval,
|
|
backup_retention_days and backup_destination to schema/service/frontend
|
|
but missed model columns and this migration.
|
|
|
|
Revision ID: 0142
|
|
Revises: 0141
|
|
"""
|
|
|
|
import sqlalchemy as sa
|
|
|
|
from alembic import op
|
|
|
|
revision = "0142"
|
|
down_revision = "0141"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.add_column(
|
|
"system_settings",
|
|
sa.Column("backup_interval", sa.String(20), nullable=False, server_default="daily"),
|
|
)
|
|
op.add_column(
|
|
"system_settings",
|
|
sa.Column("backup_retention_days", sa.Integer(), nullable=False, server_default="7"),
|
|
)
|
|
op.add_column(
|
|
"system_settings",
|
|
sa.Column("backup_destination", sa.String(20), nullable=False, server_default="local"),
|
|
)
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.drop_column("system_settings", "backup_destination")
|
|
op.drop_column("system_settings", "backup_retention_days")
|
|
op.drop_column("system_settings", "backup_interval")
|