24 lines
949 B
Python
24 lines
949 B
Python
"""Enable all authorized community sources in the staging registry."""
|
|
from alembic import op
|
|
|
|
revision = "0012"
|
|
down_revision = "0011"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade() -> None:
|
|
op.execute("""
|
|
INSERT INTO data_source (key, name, base_url, default_confidence, enabled) VALUES
|
|
('rf4db', 'RF4DB', 'https://rf4db.com', 70, true),
|
|
('rf4stat-fishing', 'RF4-STAT fishing', 'https://rf4-stat.ru/fishing/', 65, true),
|
|
('rf4stat-post', 'RF4-STAT posts', 'https://rf4-stat.ru/posts/', 60, true),
|
|
('rf4map', 'RF4MAP', 'https://rf4map.ru', 55, true),
|
|
('rf4posts-spot', 'RF4 Posts spots', 'https://rf4-posts.com', 50, true)
|
|
ON CONFLICT (key) DO UPDATE SET enabled = EXCLUDED.enabled
|
|
""")
|
|
|
|
|
|
def downgrade() -> None:
|
|
op.execute("UPDATE data_source SET enabled = false WHERE key IN ('rf4db', 'rf4stat-fishing', 'rf4stat-post', 'rf4map', 'rf4posts-spot')")
|