054_drop_legacy_cache_columns.sql 698 B

1234567891011121314
  1. -- Drop legacy cache token columns that lack the underscore separator.
  2. -- These were created by GORM's automatic snake_case conversion:
  3. -- CacheCreation5mTokens → cache_creation5m_tokens (incorrect)
  4. -- CacheCreation1hTokens → cache_creation1h_tokens (incorrect)
  5. --
  6. -- The canonical columns are:
  7. -- cache_creation_5m_tokens (defined in 001_init.sql)
  8. -- cache_creation_1h_tokens (defined in 001_init.sql)
  9. --
  10. -- Migration 009 already copied data from legacy → canonical columns.
  11. -- This migration drops the legacy columns to avoid confusion.
  12. ALTER TABLE usage_logs DROP COLUMN IF EXISTS cache_creation5m_tokens;
  13. ALTER TABLE usage_logs DROP COLUMN IF EXISTS cache_creation1h_tokens;