From 1069c93e6d73c40392daae06d08b6499ddc420ad Mon Sep 17 00:00:00 2001 From: IS1DI Date: Fri, 17 Jul 2026 22:08:20 +0400 Subject: [PATCH] Migrate on supabase --- server/.env.example | 2 +- server/internal/races/seed/seed.go | 40 +++++++++---------- .../storage/postgres/migrations/001_init.sql | 2 +- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/server/.env.example b/server/.env.example index ceb024c..f227049 100644 --- a/server/.env.example +++ b/server/.env.example @@ -9,7 +9,7 @@ # postgres://x0gp:x0gp@localhost:5432/x0gp?sslmode=disable # postgres://x0gp:x0gp@postgres:5432/x0gp?sslmode=disable (inside compose) -DATABASE_URL=postgres://x0gp:x0gp@localhost:5432/x0gp?sslmode=disable +DATABASE_URL=postgres://postgres:postgres@localhost:3402/postgres?sslmode=disable # HTTP server. X0GP_HTTP_ADDR=:8080 diff --git a/server/internal/races/seed/seed.go b/server/internal/races/seed/seed.go index 32f08d7..1f0b128 100644 --- a/server/internal/races/seed/seed.go +++ b/server/internal/races/seed/seed.go @@ -38,26 +38,26 @@ var defaultDriverSeeds = []struct { createdMs int64 updatedMs int64 }{ - {"driver-seed-001", "BOR", "Gabriel Bortoleto", "https://static.x0gp.ubu.is1di.ru/public/avatar/gabriel-bortoleto-f1-driver-profile-picture.webp", "clan-seed-001", 1784120584003, 1784120584003}, - {"driver-seed-002", "HUL", "Nico Hulkenberg", "https://static.x0gp.ubu.is1di.ru/public/avatar/nico-hulkenberg-f1-driver-profile-picture.webp", "clan-seed-002", 1784120584003, 1784120584007}, - {"driver-seed-003", "ALB", "Alex Albon", "https://static.x0gp.ubu.is1di.ru/public/avatar/alex-albon-f1-driver-profile-picture.webp", "clan-seed-003", 1784120584003, 1784120584008}, - {"driver-seed-004", "SAI", "Carlos Sainz", "https://static.x0gp.ubu.is1di.ru/public/avatar/carlos-sainz-f1-driver-profile-picture.webp", "clan-seed-001", 1784120584003, 1784120584011}, - {"driver-seed-005", "BEA", "Oliver Bearman", "https://static.x0gp.ubu.is1di.ru/public/avatar/oliver-bearman-f1-driver-profile-picture.webp", "clan-seed-002", 1784120584003, 1784120584012}, - {"driver-seed-006", "OCO", "Esteban Ocon", "https://static.x0gp.ubu.is1di.ru/public/avatar/esteban-ocon-f1-driver-profile-picture.webp", "clan-seed-003", 1784120584003, 1784120584014}, - {"driver-seed-007", "LIN", "Arvid Lindblad", "https://static.x0gp.ubu.is1di.ru/public/avatar/arvid-lindblad-f1-driver-profile-picture.webp", "clan-seed-001", 1784120584003, 1784120584018}, - {"driver-seed-008", "LAW", "Liam Lawson", "https://static.x0gp.ubu.is1di.ru/public/avatar/liam-lawson-f1-driver-profile-picture.webp", "clan-seed-002", 1784120584003, 1784120584018}, - {"driver-seed-009", "COL", "Franco Colapinto", "https://static.x0gp.ubu.is1di.ru/public/avatar/franco-colapinto-f1-driver-profile-picture.webp", "clan-seed-003", 1784120584003, 1784120584020}, - {"driver-seed-010", "GAS", "Pierre Gasly", "https://static.x0gp.ubu.is1di.ru/public/avatar/pierre-gasly-f1-driver-profile-picture.webp", "clan-seed-001", 1784120584003, 1784120584023}, - {"driver-seed-011", "STR", "Lance Stroll", "https://static.x0gp.ubu.is1di.ru/public/avatar/lance-stroll-f1-driver-profile-picture.webp", "clan-seed-002", 1784120584003, 1784120584023}, - {"driver-seed-012", "ALO", "Fernando Alonso", "https://static.x0gp.ubu.is1di.ru/public/avatar/fernando-alonso-f1-driver-profile-picture.webp", "clan-seed-003", 1784120584003, 1784120584026}, - {"driver-seed-013", "ANT", "Kimi Antonelli", "https://static.x0gp.ubu.is1di.ru/public/avatar/kimi-antonelli-f1-driver-profile-picture.webp", "clan-seed-001", 1784120584003, 1784120584028}, - {"driver-seed-014", "RUS", "George Russel", "https://static.x0gp.ubu.is1di.ru/public/avatar/george-russell-f1-driver-profile-picture.webp", "clan-seed-002", 1784120584003, 1784120584028}, - {"driver-seed-015", "HAD", "Isack Hadjar", "https://static.x0gp.ubu.is1di.ru/public/avatar/isack-hadjar-f1-driver-profile-picture.webp", "clan-seed-003", 1784120584003, 1784120584031}, - {"driver-seed-016", "VER", "Max Verstappen", "https://static.x0gp.ubu.is1di.ru/public/avatar/max-verstappen-f1-driver-profile-picture.webp", "clan-seed-001", 1784120584003, 1784120584033}, - {"driver-seed-017", "HAM", "Lewis Hamilton", "https://static.x0gp.ubu.is1di.ru/public/avatar/lewis-hamilton-f1-driver-profile-picture.webp", "clan-seed-002", 1784120584003, 1784120584034}, - {"driver-seed-018", "NOR", "Lando Norris", "https://static.x0gp.ubu.is1di.ru/public/avatar/lando-norris-f1-driver-profile-picture.webp", "clan-seed-003", 1784120584003, 1784120584036}, - {"driver-seed-019", "LEC", "Charles Leclerc", "https://static.x0gp.ubu.is1di.ru/public/avatar/charles-leclerc-f1-driver-profile-picture.webp", "clan-seed-001", 1784120584003, 1784120584038}, - {"driver-seed-020", "PIA", "Oscar Piastri", "https://static.x0gp.ubu.is1di.ru/public/avatar/oscar-piastri-f1-driver-profile-picture.webp", "clan-seed-002", 1784120584003, 1784120584039}, + {"driver-seed-001", "BOR", "Gabriel Bortoleto", "https://supabasekong.ubu.is1di.ru/storage/v1/object/public/static/avatar/gabriel-bortoleto-f1-driver-profile-picture.webp", "clan-seed-001", 1784120584003, 1784120584003}, + {"driver-seed-002", "HUL", "Nico Hulkenberg", "https://supabasekong.ubu.is1di.ru/storage/v1/object/public/static/avatar/nico-hulkenberg-f1-driver-profile-picture.webp", "clan-seed-002", 1784120584003, 1784120584007}, + {"driver-seed-003", "ALB", "Alex Albon", "https://supabasekong.ubu.is1di.ru/storage/v1/object/public/static/avatar/alex-albon-f1-driver-profile-picture.webp", "clan-seed-003", 1784120584003, 1784120584008}, + {"driver-seed-004", "SAI", "Carlos Sainz", "https://supabasekong.ubu.is1di.ru/storage/v1/object/public/static/avatar/carlos-sainz-f1-driver-profile-picture.webp", "clan-seed-001", 1784120584003, 1784120584011}, + {"driver-seed-005", "BEA", "Oliver Bearman", "https://supabasekong.ubu.is1di.ru/storage/v1/object/public/static/avatar/oliver-bearman-f1-driver-profile-picture.webp", "clan-seed-002", 1784120584003, 1784120584012}, + {"driver-seed-006", "OCO", "Esteban Ocon", "https://supabasekong.ubu.is1di.ru/storage/v1/object/public/static/avatar/esteban-ocon-f1-driver-profile-picture.webp", "clan-seed-003", 1784120584003, 1784120584014}, + {"driver-seed-007", "LIN", "Arvid Lindblad", "https://supabasekong.ubu.is1di.ru/storage/v1/object/public/static/avatar/arvid-lindblad-f1-driver-profile-picture.webp", "clan-seed-001", 1784120584003, 1784120584018}, + {"driver-seed-008", "LAW", "Liam Lawson", "https://supabasekong.ubu.is1di.ru/storage/v1/object/public/static/avatar/liam-lawson-f1-driver-profile-picture.webp", "clan-seed-002", 1784120584003, 1784120584018}, + {"driver-seed-009", "COL", "Franco Colapinto", "https://supabasekong.ubu.is1di.ru/storage/v1/object/public/static/avatar/franco-colapinto-f1-driver-profile-picture.webp", "clan-seed-003", 1784120584003, 1784120584020}, + {"driver-seed-010", "GAS", "Pierre Gasly", "https://supabasekong.ubu.is1di.ru/storage/v1/object/public/static/avatar/pierre-gasly-f1-driver-profile-picture.webp", "clan-seed-001", 1784120584003, 1784120584023}, + {"driver-seed-011", "STR", "Lance Stroll", "https://supabasekong.ubu.is1di.ru/storage/v1/object/public/static/avatar/lance-stroll-f1-driver-profile-picture.webp", "clan-seed-002", 1784120584003, 1784120584023}, + {"driver-seed-012", "ALO", "Fernando Alonso", "https://supabasekong.ubu.is1di.ru/storage/v1/object/public/static/avatar/fernando-alonso-f1-driver-profile-picture.webp", "clan-seed-003", 1784120584003, 1784120584026}, + {"driver-seed-013", "ANT", "Kimi Antonelli", "https://supabasekong.ubu.is1di.ru/storage/v1/object/public/static/avatar/kimi-antonelli-f1-driver-profile-picture.webp", "clan-seed-001", 1784120584003, 1784120584028}, + {"driver-seed-014", "RUS", "George Russel", "https://supabasekong.ubu.is1di.ru/storage/v1/object/public/static/avatar/george-russell-f1-driver-profile-picture.webp", "clan-seed-002", 1784120584003, 1784120584028}, + {"driver-seed-015", "HAD", "Isack Hadjar", "https://supabasekong.ubu.is1di.ru/storage/v1/object/public/static/avatar/isack-hadjar-f1-driver-profile-picture.webp", "clan-seed-003", 1784120584003, 1784120584031}, + {"driver-seed-016", "VER", "Max Verstappen", "https://supabasekong.ubu.is1di.ru/storage/v1/object/public/static/avatar/max-verstappen-f1-driver-profile-picture.webp", "clan-seed-001", 1784120584003, 1784120584033}, + {"driver-seed-017", "HAM", "Lewis Hamilton", "https://supabasekong.ubu.is1di.ru/storage/v1/object/public/static/avatar/lewis-hamilton-f1-driver-profile-picture.webp", "clan-seed-002", 1784120584003, 1784120584034}, + {"driver-seed-018", "NOR", "Lando Norris", "https://supabasekong.ubu.is1di.ru/storage/v1/object/public/static/avatar/lando-norris-f1-driver-profile-picture.webp", "clan-seed-003", 1784120584003, 1784120584036}, + {"driver-seed-019", "LEC", "Charles Leclerc", "https://supabasekong.ubu.is1di.ru/storage/v1/object/public/static/avatar/charles-leclerc-f1-driver-profile-picture.webp", "clan-seed-001", 1784120584003, 1784120584038}, + {"driver-seed-020", "PIA", "Oscar Piastri", "https://supabasekong.ubu.is1di.ru/storage/v1/object/public/static/avatar/oscar-piastri-f1-driver-profile-picture.webp", "clan-seed-002", 1784120584003, 1784120584039}, } // Default clans. diff --git a/server/internal/storage/postgres/migrations/001_init.sql b/server/internal/storage/postgres/migrations/001_init.sql index 8fea550..ef430cd 100644 --- a/server/internal/storage/postgres/migrations/001_init.sql +++ b/server/internal/storage/postgres/migrations/001_init.sql @@ -11,7 +11,7 @@ -- (S2). We enable it here so that the extension is provisioned alongside -- the base schema. -CREATE EXTENSION IF NOT EXISTS timescaledb; +-- CREATE EXTENSION IF NOT EXISTS timescaledb; -- --------------------------------------------------------------------------- -- Tracks