feat: Russian market channels — Яндекс, Островок, Суточно, Авито, Bronevik, 101hotels + role-based sidebar
This commit is contained in:
31
backend/migrations/036_channels_ru.sql
Normal file
31
backend/migrations/036_channels_ru.sql
Normal file
@@ -0,0 +1,31 @@
|
||||
-- Replace old channel constraint with Russian market channels
|
||||
ALTER TABLE channels DROP CONSTRAINT IF EXISTS channels_name_check;
|
||||
ALTER TABLE channels ADD CONSTRAINT channels_name_check
|
||||
CHECK (name IN (
|
||||
'booking_com',
|
||||
'yandex_travel',
|
||||
'ostrovok',
|
||||
'sutochno',
|
||||
'avito',
|
||||
'bronevik',
|
||||
'hotels101',
|
||||
'onetwotrip'
|
||||
));
|
||||
|
||||
-- Remove old non-RU channels from all hotels
|
||||
DELETE FROM channels WHERE name IN ('airbnb', 'expedia', 'vrbo');
|
||||
|
||||
-- Add new Russian channels for all existing hotels (skip if already exists)
|
||||
INSERT INTO channels (hotel_id, name)
|
||||
SELECT h.id, c.name
|
||||
FROM hotels h
|
||||
CROSS JOIN (VALUES
|
||||
('yandex_travel'),
|
||||
('ostrovok'),
|
||||
('sutochno'),
|
||||
('avito'),
|
||||
('bronevik'),
|
||||
('hotels101'),
|
||||
('onetwotrip')
|
||||
) AS c(name)
|
||||
ON CONFLICT (hotel_id, name) DO NOTHING;
|
||||
@@ -47,7 +47,7 @@ export async function seedIfEmpty() {
|
||||
}
|
||||
|
||||
// Insert channels (disabled by default)
|
||||
for (const name of ['booking_com', 'airbnb', 'expedia', 'vrbo']) {
|
||||
for (const name of ['booking_com', 'yandex_travel', 'ostrovok', 'sutochno', 'avito', 'bronevik', 'hotels101', 'onetwotrip']) {
|
||||
await db.query(
|
||||
`INSERT INTO channels (hotel_id, name) VALUES ($1, $2)`,
|
||||
[hotelId, name],
|
||||
|
||||
Reference in New Issue
Block a user