feat: backend, stream server & infra improvements
Backend (Go):
- Config: CORS, RabbitMQ, rate limit, main config updates
- Routes: core, distribution, tracks routing changes
- Middleware: rate limiter, endpoint limiter, response cache hardening
- Handlers: distribution, search handler fixes
- Workers: job worker improvements
- Upload validator and logging config additions
- New migrations: products, orders, performance indexes
- Seed tooling and data
Stream Server (Rust):
- Audio processing, config, routes, simple stream server updates
- Dockerfile improvements
Infrastructure:
- docker-compose.yml updates
- nginx-rtmp config changes
- Makefile improvements (config, dev, high, infra)
- Root package.json and lock file updates
- .env.example updates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:06 +00:00
|
|
|
-- v0.12.4: Performance & Scalabilite -- Critical indexes for query optimization
|
|
|
|
|
-- Reference: ORIGIN_PERFORMANCE_TARGETS.md S8.4
|
|
|
|
|
-- NOTE: All indexes use IF NOT EXISTS and DO $$ guards for missing tables
|
feat(v0.12.4): database performance indexes migration
Critical indexes for users, tracks, messages, playlists, follows,
comments, notifications, analytics, marketplace, education, and
full-text search GIN indexes. Reference: ORIGIN_PERFORMANCE_TARGETS.md §8.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 08:56:04 +00:00
|
|
|
|
|
|
|
|
-- ============================================================================
|
feat: backend, stream server & infra improvements
Backend (Go):
- Config: CORS, RabbitMQ, rate limit, main config updates
- Routes: core, distribution, tracks routing changes
- Middleware: rate limiter, endpoint limiter, response cache hardening
- Handlers: distribution, search handler fixes
- Workers: job worker improvements
- Upload validator and logging config additions
- New migrations: products, orders, performance indexes
- Seed tooling and data
Stream Server (Rust):
- Audio processing, config, routes, simple stream server updates
- Dockerfile improvements
Infrastructure:
- docker-compose.yml updates
- nginx-rtmp config changes
- Makefile improvements (config, dev, high, infra)
- Root package.json and lock file updates
- .env.example updates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:06 +00:00
|
|
|
-- USERS
|
feat(v0.12.4): database performance indexes migration
Critical indexes for users, tracks, messages, playlists, follows,
comments, notifications, analytics, marketplace, education, and
full-text search GIN indexes. Reference: ORIGIN_PERFORMANCE_TARGETS.md §8.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 08:56:04 +00:00
|
|
|
-- ============================================================================
|
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_users_email ON users(email);
|
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_users_username ON users(username);
|
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_users_created_at ON users(created_at DESC);
|
|
|
|
|
|
|
|
|
|
-- ============================================================================
|
feat: backend, stream server & infra improvements
Backend (Go):
- Config: CORS, RabbitMQ, rate limit, main config updates
- Routes: core, distribution, tracks routing changes
- Middleware: rate limiter, endpoint limiter, response cache hardening
- Handlers: distribution, search handler fixes
- Workers: job worker improvements
- Upload validator and logging config additions
- New migrations: products, orders, performance indexes
- Seed tooling and data
Stream Server (Rust):
- Audio processing, config, routes, simple stream server updates
- Dockerfile improvements
Infrastructure:
- docker-compose.yml updates
- nginx-rtmp config changes
- Makefile improvements (config, dev, high, infra)
- Root package.json and lock file updates
- .env.example updates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:06 +00:00
|
|
|
-- TRACKS
|
feat(v0.12.4): database performance indexes migration
Critical indexes for users, tracks, messages, playlists, follows,
comments, notifications, analytics, marketplace, education, and
full-text search GIN indexes. Reference: ORIGIN_PERFORMANCE_TARGETS.md §8.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 08:56:04 +00:00
|
|
|
-- ============================================================================
|
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_tracks_creator_id ON tracks(creator_id);
|
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_tracks_genre ON tracks(genre);
|
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_tracks_created_at ON tracks(created_at DESC);
|
|
|
|
|
|
|
|
|
|
-- ============================================================================
|
feat: backend, stream server & infra improvements
Backend (Go):
- Config: CORS, RabbitMQ, rate limit, main config updates
- Routes: core, distribution, tracks routing changes
- Middleware: rate limiter, endpoint limiter, response cache hardening
- Handlers: distribution, search handler fixes
- Workers: job worker improvements
- Upload validator and logging config additions
- New migrations: products, orders, performance indexes
- Seed tooling and data
Stream Server (Rust):
- Audio processing, config, routes, simple stream server updates
- Dockerfile improvements
Infrastructure:
- docker-compose.yml updates
- nginx-rtmp config changes
- Makefile improvements (config, dev, high, infra)
- Root package.json and lock file updates
- .env.example updates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:06 +00:00
|
|
|
-- MESSAGES
|
feat(v0.12.4): database performance indexes migration
Critical indexes for users, tracks, messages, playlists, follows,
comments, notifications, analytics, marketplace, education, and
full-text search GIN indexes. Reference: ORIGIN_PERFORMANCE_TARGETS.md §8.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 08:56:04 +00:00
|
|
|
-- ============================================================================
|
feat: backend, stream server & infra improvements
Backend (Go):
- Config: CORS, RabbitMQ, rate limit, main config updates
- Routes: core, distribution, tracks routing changes
- Middleware: rate limiter, endpoint limiter, response cache hardening
- Handlers: distribution, search handler fixes
- Workers: job worker improvements
- Upload validator and logging config additions
- New migrations: products, orders, performance indexes
- Seed tooling and data
Stream Server (Rust):
- Audio processing, config, routes, simple stream server updates
- Dockerfile improvements
Infrastructure:
- docker-compose.yml updates
- nginx-rtmp config changes
- Makefile improvements (config, dev, high, infra)
- Root package.json and lock file updates
- .env.example updates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:06 +00:00
|
|
|
DO $$ BEGIN
|
|
|
|
|
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema='public' AND table_name='messages') THEN
|
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_messages_room_created ON messages(room_id, created_at DESC);
|
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_messages_sender_id ON messages(sender_id);
|
|
|
|
|
END IF;
|
|
|
|
|
END $$;
|
feat(v0.12.4): database performance indexes migration
Critical indexes for users, tracks, messages, playlists, follows,
comments, notifications, analytics, marketplace, education, and
full-text search GIN indexes. Reference: ORIGIN_PERFORMANCE_TARGETS.md §8.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 08:56:04 +00:00
|
|
|
|
|
|
|
|
-- ============================================================================
|
feat: backend, stream server & infra improvements
Backend (Go):
- Config: CORS, RabbitMQ, rate limit, main config updates
- Routes: core, distribution, tracks routing changes
- Middleware: rate limiter, endpoint limiter, response cache hardening
- Handlers: distribution, search handler fixes
- Workers: job worker improvements
- Upload validator and logging config additions
- New migrations: products, orders, performance indexes
- Seed tooling and data
Stream Server (Rust):
- Audio processing, config, routes, simple stream server updates
- Dockerfile improvements
Infrastructure:
- docker-compose.yml updates
- nginx-rtmp config changes
- Makefile improvements (config, dev, high, infra)
- Root package.json and lock file updates
- .env.example updates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:06 +00:00
|
|
|
-- PLAYLISTS
|
feat(v0.12.4): database performance indexes migration
Critical indexes for users, tracks, messages, playlists, follows,
comments, notifications, analytics, marketplace, education, and
full-text search GIN indexes. Reference: ORIGIN_PERFORMANCE_TARGETS.md §8.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 08:56:04 +00:00
|
|
|
-- ============================================================================
|
feat: backend, stream server & infra improvements
Backend (Go):
- Config: CORS, RabbitMQ, rate limit, main config updates
- Routes: core, distribution, tracks routing changes
- Middleware: rate limiter, endpoint limiter, response cache hardening
- Handlers: distribution, search handler fixes
- Workers: job worker improvements
- Upload validator and logging config additions
- New migrations: products, orders, performance indexes
- Seed tooling and data
Stream Server (Rust):
- Audio processing, config, routes, simple stream server updates
- Dockerfile improvements
Infrastructure:
- docker-compose.yml updates
- nginx-rtmp config changes
- Makefile improvements (config, dev, high, infra)
- Root package.json and lock file updates
- .env.example updates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:06 +00:00
|
|
|
DO $$ BEGIN
|
|
|
|
|
IF EXISTS (SELECT 1 FROM information_schema.columns WHERE table_name='playlists' AND column_name='creator_id') THEN
|
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_playlists_creator_id ON playlists(creator_id);
|
|
|
|
|
END IF;
|
|
|
|
|
IF EXISTS (SELECT 1 FROM information_schema.columns WHERE table_name='playlists' AND column_name='is_public') THEN
|
|
|
|
|
EXECUTE 'CREATE INDEX IF NOT EXISTS idx_playlists_public_created ON playlists(is_public, created_at DESC)';
|
|
|
|
|
END IF;
|
|
|
|
|
END $$;
|
feat(v0.12.4): database performance indexes migration
Critical indexes for users, tracks, messages, playlists, follows,
comments, notifications, analytics, marketplace, education, and
full-text search GIN indexes. Reference: ORIGIN_PERFORMANCE_TARGETS.md §8.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 08:56:04 +00:00
|
|
|
|
|
|
|
|
-- ============================================================================
|
feat: backend, stream server & infra improvements
Backend (Go):
- Config: CORS, RabbitMQ, rate limit, main config updates
- Routes: core, distribution, tracks routing changes
- Middleware: rate limiter, endpoint limiter, response cache hardening
- Handlers: distribution, search handler fixes
- Workers: job worker improvements
- Upload validator and logging config additions
- New migrations: products, orders, performance indexes
- Seed tooling and data
Stream Server (Rust):
- Audio processing, config, routes, simple stream server updates
- Dockerfile improvements
Infrastructure:
- docker-compose.yml updates
- nginx-rtmp config changes
- Makefile improvements (config, dev, high, infra)
- Root package.json and lock file updates
- .env.example updates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:06 +00:00
|
|
|
-- PLAYLIST TRACKS
|
feat(v0.12.4): database performance indexes migration
Critical indexes for users, tracks, messages, playlists, follows,
comments, notifications, analytics, marketplace, education, and
full-text search GIN indexes. Reference: ORIGIN_PERFORMANCE_TARGETS.md §8.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 08:56:04 +00:00
|
|
|
-- ============================================================================
|
feat: backend, stream server & infra improvements
Backend (Go):
- Config: CORS, RabbitMQ, rate limit, main config updates
- Routes: core, distribution, tracks routing changes
- Middleware: rate limiter, endpoint limiter, response cache hardening
- Handlers: distribution, search handler fixes
- Workers: job worker improvements
- Upload validator and logging config additions
- New migrations: products, orders, performance indexes
- Seed tooling and data
Stream Server (Rust):
- Audio processing, config, routes, simple stream server updates
- Dockerfile improvements
Infrastructure:
- docker-compose.yml updates
- nginx-rtmp config changes
- Makefile improvements (config, dev, high, infra)
- Root package.json and lock file updates
- .env.example updates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:06 +00:00
|
|
|
DO $$ BEGIN
|
|
|
|
|
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema='public' AND table_name='playlist_tracks') THEN
|
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_playlist_tracks_playlist ON playlist_tracks(playlist_id, position);
|
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_playlist_tracks_track ON playlist_tracks(track_id);
|
|
|
|
|
END IF;
|
|
|
|
|
END $$;
|
feat(v0.12.4): database performance indexes migration
Critical indexes for users, tracks, messages, playlists, follows,
comments, notifications, analytics, marketplace, education, and
full-text search GIN indexes. Reference: ORIGIN_PERFORMANCE_TARGETS.md §8.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 08:56:04 +00:00
|
|
|
|
|
|
|
|
-- ============================================================================
|
feat: backend, stream server & infra improvements
Backend (Go):
- Config: CORS, RabbitMQ, rate limit, main config updates
- Routes: core, distribution, tracks routing changes
- Middleware: rate limiter, endpoint limiter, response cache hardening
- Handlers: distribution, search handler fixes
- Workers: job worker improvements
- Upload validator and logging config additions
- New migrations: products, orders, performance indexes
- Seed tooling and data
Stream Server (Rust):
- Audio processing, config, routes, simple stream server updates
- Dockerfile improvements
Infrastructure:
- docker-compose.yml updates
- nginx-rtmp config changes
- Makefile improvements (config, dev, high, infra)
- Root package.json and lock file updates
- .env.example updates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:06 +00:00
|
|
|
-- FOLLOWS
|
feat(v0.12.4): database performance indexes migration
Critical indexes for users, tracks, messages, playlists, follows,
comments, notifications, analytics, marketplace, education, and
full-text search GIN indexes. Reference: ORIGIN_PERFORMANCE_TARGETS.md §8.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 08:56:04 +00:00
|
|
|
-- ============================================================================
|
feat: backend, stream server & infra improvements
Backend (Go):
- Config: CORS, RabbitMQ, rate limit, main config updates
- Routes: core, distribution, tracks routing changes
- Middleware: rate limiter, endpoint limiter, response cache hardening
- Handlers: distribution, search handler fixes
- Workers: job worker improvements
- Upload validator and logging config additions
- New migrations: products, orders, performance indexes
- Seed tooling and data
Stream Server (Rust):
- Audio processing, config, routes, simple stream server updates
- Dockerfile improvements
Infrastructure:
- docker-compose.yml updates
- nginx-rtmp config changes
- Makefile improvements (config, dev, high, infra)
- Root package.json and lock file updates
- .env.example updates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:06 +00:00
|
|
|
DO $$ BEGIN
|
|
|
|
|
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema='public' AND table_name='follows') THEN
|
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_follows_follower ON follows(follower_id);
|
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_follows_following ON follows(followed_id);
|
|
|
|
|
END IF;
|
|
|
|
|
END $$;
|
feat(v0.12.4): database performance indexes migration
Critical indexes for users, tracks, messages, playlists, follows,
comments, notifications, analytics, marketplace, education, and
full-text search GIN indexes. Reference: ORIGIN_PERFORMANCE_TARGETS.md §8.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 08:56:04 +00:00
|
|
|
|
|
|
|
|
-- ============================================================================
|
feat: backend, stream server & infra improvements
Backend (Go):
- Config: CORS, RabbitMQ, rate limit, main config updates
- Routes: core, distribution, tracks routing changes
- Middleware: rate limiter, endpoint limiter, response cache hardening
- Handlers: distribution, search handler fixes
- Workers: job worker improvements
- Upload validator and logging config additions
- New migrations: products, orders, performance indexes
- Seed tooling and data
Stream Server (Rust):
- Audio processing, config, routes, simple stream server updates
- Dockerfile improvements
Infrastructure:
- docker-compose.yml updates
- nginx-rtmp config changes
- Makefile improvements (config, dev, high, infra)
- Root package.json and lock file updates
- .env.example updates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:06 +00:00
|
|
|
-- COMMENTS
|
feat(v0.12.4): database performance indexes migration
Critical indexes for users, tracks, messages, playlists, follows,
comments, notifications, analytics, marketplace, education, and
full-text search GIN indexes. Reference: ORIGIN_PERFORMANCE_TARGETS.md §8.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 08:56:04 +00:00
|
|
|
-- ============================================================================
|
feat: backend, stream server & infra improvements
Backend (Go):
- Config: CORS, RabbitMQ, rate limit, main config updates
- Routes: core, distribution, tracks routing changes
- Middleware: rate limiter, endpoint limiter, response cache hardening
- Handlers: distribution, search handler fixes
- Workers: job worker improvements
- Upload validator and logging config additions
- New migrations: products, orders, performance indexes
- Seed tooling and data
Stream Server (Rust):
- Audio processing, config, routes, simple stream server updates
- Dockerfile improvements
Infrastructure:
- docker-compose.yml updates
- nginx-rtmp config changes
- Makefile improvements (config, dev, high, infra)
- Root package.json and lock file updates
- .env.example updates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:06 +00:00
|
|
|
DO $$ BEGIN
|
|
|
|
|
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema='public' AND table_name='comments') THEN
|
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_comments_user ON comments(user_id);
|
|
|
|
|
END IF;
|
|
|
|
|
END $$;
|
feat(v0.12.4): database performance indexes migration
Critical indexes for users, tracks, messages, playlists, follows,
comments, notifications, analytics, marketplace, education, and
full-text search GIN indexes. Reference: ORIGIN_PERFORMANCE_TARGETS.md §8.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 08:56:04 +00:00
|
|
|
|
|
|
|
|
-- ============================================================================
|
feat: backend, stream server & infra improvements
Backend (Go):
- Config: CORS, RabbitMQ, rate limit, main config updates
- Routes: core, distribution, tracks routing changes
- Middleware: rate limiter, endpoint limiter, response cache hardening
- Handlers: distribution, search handler fixes
- Workers: job worker improvements
- Upload validator and logging config additions
- New migrations: products, orders, performance indexes
- Seed tooling and data
Stream Server (Rust):
- Audio processing, config, routes, simple stream server updates
- Dockerfile improvements
Infrastructure:
- docker-compose.yml updates
- nginx-rtmp config changes
- Makefile improvements (config, dev, high, infra)
- Root package.json and lock file updates
- .env.example updates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:06 +00:00
|
|
|
-- NOTIFICATIONS
|
feat(v0.12.4): database performance indexes migration
Critical indexes for users, tracks, messages, playlists, follows,
comments, notifications, analytics, marketplace, education, and
full-text search GIN indexes. Reference: ORIGIN_PERFORMANCE_TARGETS.md §8.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 08:56:04 +00:00
|
|
|
-- ============================================================================
|
feat: backend, stream server & infra improvements
Backend (Go):
- Config: CORS, RabbitMQ, rate limit, main config updates
- Routes: core, distribution, tracks routing changes
- Middleware: rate limiter, endpoint limiter, response cache hardening
- Handlers: distribution, search handler fixes
- Workers: job worker improvements
- Upload validator and logging config additions
- New migrations: products, orders, performance indexes
- Seed tooling and data
Stream Server (Rust):
- Audio processing, config, routes, simple stream server updates
- Dockerfile improvements
Infrastructure:
- docker-compose.yml updates
- nginx-rtmp config changes
- Makefile improvements (config, dev, high, infra)
- Root package.json and lock file updates
- .env.example updates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:06 +00:00
|
|
|
DO $$ BEGIN
|
|
|
|
|
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema='public' AND table_name='notifications') THEN
|
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_notifications_user_created ON notifications(user_id, created_at DESC);
|
|
|
|
|
END IF;
|
|
|
|
|
END $$;
|
feat(v0.12.4): database performance indexes migration
Critical indexes for users, tracks, messages, playlists, follows,
comments, notifications, analytics, marketplace, education, and
full-text search GIN indexes. Reference: ORIGIN_PERFORMANCE_TARGETS.md §8.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 08:56:04 +00:00
|
|
|
|
|
|
|
|
-- ============================================================================
|
feat: backend, stream server & infra improvements
Backend (Go):
- Config: CORS, RabbitMQ, rate limit, main config updates
- Routes: core, distribution, tracks routing changes
- Middleware: rate limiter, endpoint limiter, response cache hardening
- Handlers: distribution, search handler fixes
- Workers: job worker improvements
- Upload validator and logging config additions
- New migrations: products, orders, performance indexes
- Seed tooling and data
Stream Server (Rust):
- Audio processing, config, routes, simple stream server updates
- Dockerfile improvements
Infrastructure:
- docker-compose.yml updates
- nginx-rtmp config changes
- Makefile improvements (config, dev, high, infra)
- Root package.json and lock file updates
- .env.example updates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:06 +00:00
|
|
|
-- ANALYTICS
|
feat(v0.12.4): database performance indexes migration
Critical indexes for users, tracks, messages, playlists, follows,
comments, notifications, analytics, marketplace, education, and
full-text search GIN indexes. Reference: ORIGIN_PERFORMANCE_TARGETS.md §8.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 08:56:04 +00:00
|
|
|
-- ============================================================================
|
feat: backend, stream server & infra improvements
Backend (Go):
- Config: CORS, RabbitMQ, rate limit, main config updates
- Routes: core, distribution, tracks routing changes
- Middleware: rate limiter, endpoint limiter, response cache hardening
- Handlers: distribution, search handler fixes
- Workers: job worker improvements
- Upload validator and logging config additions
- New migrations: products, orders, performance indexes
- Seed tooling and data
Stream Server (Rust):
- Audio processing, config, routes, simple stream server updates
- Dockerfile improvements
Infrastructure:
- docker-compose.yml updates
- nginx-rtmp config changes
- Makefile improvements (config, dev, high, infra)
- Root package.json and lock file updates
- .env.example updates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:06 +00:00
|
|
|
DO $$ BEGIN
|
|
|
|
|
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema='public' AND table_name='track_plays') THEN
|
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_track_plays_track_date ON track_plays(track_id, played_at DESC);
|
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_track_plays_user ON track_plays(user_id, played_at DESC);
|
|
|
|
|
END IF;
|
|
|
|
|
END $$;
|
feat(v0.12.4): database performance indexes migration
Critical indexes for users, tracks, messages, playlists, follows,
comments, notifications, analytics, marketplace, education, and
full-text search GIN indexes. Reference: ORIGIN_PERFORMANCE_TARGETS.md §8.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 08:56:04 +00:00
|
|
|
|
|
|
|
|
-- ============================================================================
|
feat: backend, stream server & infra improvements
Backend (Go):
- Config: CORS, RabbitMQ, rate limit, main config updates
- Routes: core, distribution, tracks routing changes
- Middleware: rate limiter, endpoint limiter, response cache hardening
- Handlers: distribution, search handler fixes
- Workers: job worker improvements
- Upload validator and logging config additions
- New migrations: products, orders, performance indexes
- Seed tooling and data
Stream Server (Rust):
- Audio processing, config, routes, simple stream server updates
- Dockerfile improvements
Infrastructure:
- docker-compose.yml updates
- nginx-rtmp config changes
- Makefile improvements (config, dev, high, infra)
- Root package.json and lock file updates
- .env.example updates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:06 +00:00
|
|
|
-- MARKETPLACE (tables may not exist yet)
|
|
|
|
|
-- ============================================================================
|
|
|
|
|
DO $$ BEGIN
|
|
|
|
|
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema='public' AND table_name='marketplace_listings') THEN
|
|
|
|
|
EXECUTE 'CREATE INDEX IF NOT EXISTS idx_marketplace_listings_status ON marketplace_listings(status, created_at DESC)';
|
|
|
|
|
END IF;
|
|
|
|
|
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema='public' AND table_name='marketplace_transactions') THEN
|
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_marketplace_transactions_buyer ON marketplace_transactions(buyer_id, created_at DESC);
|
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_marketplace_transactions_seller ON marketplace_transactions(seller_id, created_at DESC);
|
|
|
|
|
END IF;
|
|
|
|
|
END $$;
|
feat(v0.12.4): database performance indexes migration
Critical indexes for users, tracks, messages, playlists, follows,
comments, notifications, analytics, marketplace, education, and
full-text search GIN indexes. Reference: ORIGIN_PERFORMANCE_TARGETS.md §8.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 08:56:04 +00:00
|
|
|
|
|
|
|
|
-- ============================================================================
|
feat: backend, stream server & infra improvements
Backend (Go):
- Config: CORS, RabbitMQ, rate limit, main config updates
- Routes: core, distribution, tracks routing changes
- Middleware: rate limiter, endpoint limiter, response cache hardening
- Handlers: distribution, search handler fixes
- Workers: job worker improvements
- Upload validator and logging config additions
- New migrations: products, orders, performance indexes
- Seed tooling and data
Stream Server (Rust):
- Audio processing, config, routes, simple stream server updates
- Dockerfile improvements
Infrastructure:
- docker-compose.yml updates
- nginx-rtmp config changes
- Makefile improvements (config, dev, high, infra)
- Root package.json and lock file updates
- .env.example updates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:06 +00:00
|
|
|
-- EDUCATION (tables may not exist yet)
|
feat(v0.12.4): database performance indexes migration
Critical indexes for users, tracks, messages, playlists, follows,
comments, notifications, analytics, marketplace, education, and
full-text search GIN indexes. Reference: ORIGIN_PERFORMANCE_TARGETS.md §8.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 08:56:04 +00:00
|
|
|
-- ============================================================================
|
feat: backend, stream server & infra improvements
Backend (Go):
- Config: CORS, RabbitMQ, rate limit, main config updates
- Routes: core, distribution, tracks routing changes
- Middleware: rate limiter, endpoint limiter, response cache hardening
- Handlers: distribution, search handler fixes
- Workers: job worker improvements
- Upload validator and logging config additions
- New migrations: products, orders, performance indexes
- Seed tooling and data
Stream Server (Rust):
- Audio processing, config, routes, simple stream server updates
- Dockerfile improvements
Infrastructure:
- docker-compose.yml updates
- nginx-rtmp config changes
- Makefile improvements (config, dev, high, infra)
- Root package.json and lock file updates
- .env.example updates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:06 +00:00
|
|
|
DO $$ BEGIN
|
|
|
|
|
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema='public' AND table_name='courses') THEN
|
|
|
|
|
EXECUTE 'CREATE INDEX IF NOT EXISTS idx_courses_status_created ON courses(status, created_at DESC)';
|
|
|
|
|
END IF;
|
|
|
|
|
IF EXISTS (SELECT 1 FROM information_schema.tables WHERE table_schema='public' AND table_name='course_enrollments') THEN
|
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_course_enrollments_user ON course_enrollments(user_id, created_at DESC);
|
|
|
|
|
END IF;
|
|
|
|
|
END $$;
|
feat(v0.12.4): database performance indexes migration
Critical indexes for users, tracks, messages, playlists, follows,
comments, notifications, analytics, marketplace, education, and
full-text search GIN indexes. Reference: ORIGIN_PERFORMANCE_TARGETS.md §8.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 08:56:04 +00:00
|
|
|
|
|
|
|
|
-- ============================================================================
|
feat: backend, stream server & infra improvements
Backend (Go):
- Config: CORS, RabbitMQ, rate limit, main config updates
- Routes: core, distribution, tracks routing changes
- Middleware: rate limiter, endpoint limiter, response cache hardening
- Handlers: distribution, search handler fixes
- Workers: job worker improvements
- Upload validator and logging config additions
- New migrations: products, orders, performance indexes
- Seed tooling and data
Stream Server (Rust):
- Audio processing, config, routes, simple stream server updates
- Dockerfile improvements
Infrastructure:
- docker-compose.yml updates
- nginx-rtmp config changes
- Makefile improvements (config, dev, high, infra)
- Root package.json and lock file updates
- .env.example updates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:06 +00:00
|
|
|
-- FULL-TEXT SEARCH
|
|
|
|
|
-- ============================================================================
|
|
|
|
|
DO $$ BEGIN
|
|
|
|
|
IF EXISTS (SELECT 1 FROM information_schema.columns WHERE table_name='tracks' AND column_name='title') THEN
|
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_tracks_search_gin ON tracks
|
|
|
|
|
USING GIN(to_tsvector('english', COALESCE(title, '') || ' ' || COALESCE(description, '')));
|
|
|
|
|
END IF;
|
|
|
|
|
IF EXISTS (SELECT 1 FROM information_schema.columns WHERE table_name='users' AND column_name='display_name') THEN
|
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_users_search_gin ON users
|
|
|
|
|
USING GIN(to_tsvector('english', COALESCE(username, '') || ' ' || COALESCE(display_name, '')));
|
|
|
|
|
END IF;
|
|
|
|
|
END $$;
|
feat(v0.12.4): database performance indexes migration
Critical indexes for users, tracks, messages, playlists, follows,
comments, notifications, analytics, marketplace, education, and
full-text search GIN indexes. Reference: ORIGIN_PERFORMANCE_TARGETS.md §8.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 08:56:04 +00:00
|
|
|
|
|
|
|
|
-- ============================================================================
|
feat: backend, stream server & infra improvements
Backend (Go):
- Config: CORS, RabbitMQ, rate limit, main config updates
- Routes: core, distribution, tracks routing changes
- Middleware: rate limiter, endpoint limiter, response cache hardening
- Handlers: distribution, search handler fixes
- Workers: job worker improvements
- Upload validator and logging config additions
- New migrations: products, orders, performance indexes
- Seed tooling and data
Stream Server (Rust):
- Audio processing, config, routes, simple stream server updates
- Dockerfile improvements
Infrastructure:
- docker-compose.yml updates
- nginx-rtmp config changes
- Makefile improvements (config, dev, high, infra)
- Root package.json and lock file updates
- .env.example updates
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-18 10:36:06 +00:00
|
|
|
-- STATISTICS
|
feat(v0.12.4): database performance indexes migration
Critical indexes for users, tracks, messages, playlists, follows,
comments, notifications, analytics, marketplace, education, and
full-text search GIN indexes. Reference: ORIGIN_PERFORMANCE_TARGETS.md §8.4
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-11 08:56:04 +00:00
|
|
|
-- ============================================================================
|
|
|
|
|
ANALYZE users;
|
|
|
|
|
ANALYZE tracks;
|