From 936d3cf690ace9adfdfe0fb44193c11a0cb26d95 Mon Sep 17 00:00:00 2001 From: Kyren223 Date: Thu, 9 Jan 2025 17:28:46 +0200 Subject: Added goose for migrations, refactored SQL schema, server and client are broken --- internal/server/api/migrations/20250109144057_indices.sql | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 internal/server/api/migrations/20250109144057_indices.sql (limited to 'internal/server/api/migrations/20250109144057_indices.sql') diff --git a/internal/server/api/migrations/20250109144057_indices.sql b/internal/server/api/migrations/20250109144057_indices.sql new file mode 100644 index 0000000..1732fb2 --- /dev/null +++ b/internal/server/api/migrations/20250109144057_indices.sql @@ -0,0 +1,9 @@ +-- +goose Up +CREATE INDEX IF NOT EXISTS idx_frequency_network ON frequencies (network_id); +CREATE INDEX IF NOT EXISTS idx_frequency_messages ON messages (frequency_id); +CREATE INDEX IF NOT EXISTS idx_direct_messages ON messages (sender_id, receiver_id); + +-- +goose Down +DROP INDEX IF EXISTS idx_frequency_network; +DROP INDEX IF EXISTS idx_frequency_messages; +DROP INDEX IF EXISTS idx_direct_messages; -- cgit v1.3.1