fix(migrations): correct migration numbers and remove broken trigger

Migration 000029 and 000030 had off-by-one numbering in comments/notices.
Also removed update_updated_at_column() trigger from 000030 as the
function is never defined and no other table uses this pattern.
This commit is contained in:
ChenRussell
2026-04-03 10:47:34 +08:00
committed by lyingbug
parent 9bb776a91c
commit 2cbd98e36f
3 changed files with 9 additions and 15 deletions
@@ -1,6 +1,6 @@
-- Migration: 000028_datasource_tables
-- Migration: 000029_datasource_tables
-- Description: Create data_sources and sync_logs tables for external data source management
DO $$ BEGIN RAISE NOTICE '[Migration 000028] Creating data_sources and sync_logs tables'; END $$;
DO $$ BEGIN RAISE NOTICE '[Migration 000029] Creating data_sources and sync_logs tables'; END $$;
-- Create data_sources table for managing external data source configurations
CREATE TABLE IF NOT EXISTS data_sources (
@@ -57,4 +57,4 @@ CREATE INDEX IF NOT EXISTS idx_sync_logs_status ON sync_logs (status);
CREATE INDEX IF NOT EXISTS idx_sync_logs_started_at ON sync_logs (started_at);
DO $$ BEGIN RAISE NOTICE '[Migration 000028] data_sources and sync_logs tables created successfully'; END $$;
DO $$ BEGIN RAISE NOTICE '[Migration 000029] data_sources and sync_logs tables created successfully'; END $$;
@@ -1,6 +1,6 @@
-- Migration: 000029_web_search_providers
-- Migration: 000030_web_search_providers
-- Description: Create web_search_providers table for tenant-specific search engine configurations
DO $$ BEGIN RAISE NOTICE '[Migration 000029] Creating web_search_providers table'; END $$;
DO $$ BEGIN RAISE NOTICE '[Migration 000030] Creating web_search_providers table'; END $$;
-- Create web_search_providers table for managing tenant search engine configurations
-- Each row represents a configured search provider instance (e.g., "Production Bing", "Test Google")
@@ -22,10 +22,4 @@ CREATE INDEX IF NOT EXISTS idx_web_search_providers_tenant_id ON web_search_prov
CREATE INDEX IF NOT EXISTS idx_web_search_providers_provider ON web_search_providers (provider);
CREATE INDEX IF NOT EXISTS idx_web_search_providers_deleted_at ON web_search_providers (deleted_at);
-- Auto-update updated_at column (reuses the function from migration 000028)
CREATE TRIGGER trg_web_search_providers_updated_at
BEFORE UPDATE ON web_search_providers
FOR EACH ROW
EXECUTE FUNCTION update_updated_at_column();
DO $$ BEGIN RAISE NOTICE '[Migration 000029] web_search_providers table created successfully'; END $$;
DO $$ BEGIN RAISE NOTICE '[Migration 000030] web_search_providers table created successfully'; END $$;
@@ -1,10 +1,10 @@
-- Migration: 000025_add_asr_config
-- Migration: 000031_add_asr_config
-- Description: Add asr_config column to knowledge_bases for ASR (Automatic Speech Recognition) configuration.
-- ASR config stores the model ID and language settings for audio transcription.
DO $$ BEGIN RAISE NOTICE '[Migration 000025] Adding asr_config column to knowledge_bases'; END $$;
DO $$ BEGIN RAISE NOTICE '[Migration 000031] Adding asr_config column to knowledge_bases'; END $$;
ALTER TABLE knowledge_bases ADD COLUMN IF NOT EXISTS asr_config JSONB;
COMMENT ON COLUMN knowledge_bases.asr_config IS 'ASR (Automatic Speech Recognition) configuration: {"enabled": bool, "model_id": string, "language": string}';
DO $$ BEGIN RAISE NOTICE '[Migration 000025] asr_config column added successfully'; END $$;
DO $$ BEGIN RAISE NOTICE '[Migration 000031] asr_config column added successfully'; END $$;