80 lines
2.6 KiB
SQL
80 lines
2.6 KiB
SQL
-- Настройки проекта и источники парсинга теперь хранятся в БД, а не в .env.
|
||
|
||
CREATE TABLE IF NOT EXISTS app_settings (
|
||
key VARCHAR(100) PRIMARY KEY,
|
||
value TEXT NOT NULL DEFAULT '',
|
||
updated_at TIMESTAMP NOT NULL DEFAULT NOW()
|
||
);
|
||
|
||
CREATE TABLE IF NOT EXISTS parser_sources (
|
||
key VARCHAR(50) PRIMARY KEY,
|
||
title VARCHAR(255) NOT NULL,
|
||
tournament_id VARCHAR(100),
|
||
round_id VARCHAR(100),
|
||
season VARCHAR(50),
|
||
calendar_type VARCHAR(50) NOT NULL DEFAULT 'tours',
|
||
logo_base_path TEXT,
|
||
photo_base_path TEXT,
|
||
teams_url TEXT,
|
||
schedule_url TEXT,
|
||
standings_url TEXT,
|
||
match_base_url TEXT,
|
||
base_url TEXT NOT NULL DEFAULT 'https://wfl.rfs.ru',
|
||
sort_order INTEGER NOT NULL DEFAULT 100,
|
||
is_active BOOLEAN NOT NULL DEFAULT TRUE,
|
||
created_at TIMESTAMP NOT NULL DEFAULT NOW(),
|
||
updated_at TIMESTAMP NOT NULL DEFAULT NOW()
|
||
);
|
||
|
||
INSERT INTO app_settings (key, value, updated_at)
|
||
VALUES
|
||
('default_parser_source_key', 'SUPERLEAGUE', NOW()),
|
||
('rfs_base_url', 'https://wfl.rfs.ru', NOW())
|
||
ON CONFLICT (key) DO NOTHING;
|
||
|
||
INSERT INTO parser_sources (
|
||
key, title, tournament_id, round_id, season, calendar_type, logo_base_path, photo_base_path,
|
||
teams_url, schedule_url, standings_url, match_base_url, base_url,
|
||
sort_order, is_active, created_at, updated_at
|
||
)
|
||
VALUES
|
||
(
|
||
'SUPERLEAGUE',
|
||
'Суперлига 2026',
|
||
'1061879',
|
||
'1117550',
|
||
'2025/2026',
|
||
'tours',
|
||
'D:\Графика\ФУТБОЛ\Женская Суперлига 2026\Teams Logos',
|
||
'D:\Графика\ФУТБОЛ\Женская Суперлига 2026\Photo',
|
||
'https://wfl.rfs.ru/tournament/1061879/teams',
|
||
'https://wfl.rfs.ru/tournament/1061879/calendar?round_id=1117550&type=tours',
|
||
'https://wfl.rfs.ru/tournament/1061879/tables',
|
||
'https://wfl.rfs.ru/match/',
|
||
'https://wfl.rfs.ru',
|
||
10,
|
||
TRUE,
|
||
NOW(),
|
||
NOW()
|
||
),
|
||
(
|
||
'RUSSIAN_CUP',
|
||
'Кубок России 2026',
|
||
'1064908',
|
||
'1125159',
|
||
'2026',
|
||
'stages',
|
||
'D:\Графика\ФУТБОЛ\Кубок России 2026\Teams Logos',
|
||
'D:\Графика\ФУТБОЛ\Кубок России 2026\Photo',
|
||
'https://wfl.rfs.ru/tournament/1064908/teams',
|
||
'https://wfl.rfs.ru/tournament/1064908/calendar?round_id=1125159&type=stages',
|
||
'https://wfl.rfs.ru/tournament/1064908/tables',
|
||
'https://wfl.rfs.ru/match/',
|
||
'https://wfl.rfs.ru',
|
||
20,
|
||
TRUE,
|
||
NOW(),
|
||
NOW()
|
||
)
|
||
ON CONFLICT (key) DO NOTHING;
|