mirror of
https://github.com/Dictionarry-Hub/profilarr.git
synced 2025-12-23 23:07:42 -05:00
fix(migration): update default language score
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -20,6 +20,7 @@ backend/app/static/
|
||||
|
||||
# Config data
|
||||
config/
|
||||
config-test/
|
||||
radarr-config/
|
||||
sonarr-config/
|
||||
test-data/
|
||||
@@ -0,0 +1,33 @@
|
||||
# backend/app/db/migrations/versions/004_update_language_score_default.py
|
||||
from ...connection import get_db
|
||||
|
||||
version = 4
|
||||
name = "update_language_score_default"
|
||||
|
||||
|
||||
def up():
|
||||
"""Update default language import score to -999999."""
|
||||
with get_db() as conn:
|
||||
# Update existing record to new default value
|
||||
conn.execute('''
|
||||
UPDATE language_import_config
|
||||
SET score = -999999,
|
||||
updated_at = CURRENT_TIMESTAMP
|
||||
WHERE id = 1
|
||||
''')
|
||||
|
||||
conn.commit()
|
||||
|
||||
|
||||
def down():
|
||||
"""Revert language import score to previous default."""
|
||||
with get_db() as conn:
|
||||
# Revert to previous default value
|
||||
conn.execute('''
|
||||
UPDATE language_import_config
|
||||
SET score = -99999,
|
||||
updated_at = CURRENT_TIMESTAMP
|
||||
WHERE id = 1
|
||||
''')
|
||||
|
||||
conn.commit()
|
||||
Reference in New Issue
Block a user