0043_drop_web_api_keys.down.sql 664 B

12345678910111213141516
  1. -- Rollback: recreate the Web API key table as 0023 defined it, less the
  2. -- last_used column 0042 dropped.
  3. CREATE TABLE IF NOT EXISTS web_api_keys (
  4. dev_id VARCHAR(255) PRIMARY KEY,
  5. dev_key VARCHAR(255) UNIQUE NOT NULL,
  6. app_name VARCHAR(255) NOT NULL,
  7. created_at INTEGER NOT NULL,
  8. is_active BOOLEAN DEFAULT 1,
  9. rate_limit INTEGER DEFAULT 60,
  10. allowed_origins TEXT, -- JSON array of allowed CORS origins
  11. capabilities TEXT -- JSON array of enabled features/endpoints
  12. );
  13. CREATE INDEX IF NOT EXISTS idx_web_api_keys_dev_key ON web_api_keys(dev_key);
  14. CREATE INDEX IF NOT EXISTS idx_web_api_keys_is_active ON web_api_keys(is_active);