0017_web_preferences.up.sql 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. -- Create table for Web API user preferences
  2. CREATE TABLE IF NOT EXISTS web_preferences
  3. (
  4. screen_name VARCHAR(16) PRIMARY KEY,
  5. preferences TEXT, -- JSON object of preference key-value pairs
  6. created_at INTEGER NOT NULL,
  7. updated_at INTEGER NOT NULL
  8. );
  9. -- Create index for efficient lookups
  10. CREATE INDEX idx_web_preferences_screen_name ON web_preferences(screen_name);
  11. -- Ensure buddyListMode table exists (for PD mode storage)
  12. -- This should already exist from migration 0010, but we'll add IF NOT EXISTS for safety
  13. CREATE TABLE IF NOT EXISTS buddyListMode
  14. (
  15. screenName VARCHAR(16),
  16. clientSidePDMode INTEGER DEFAULT 0,
  17. useFeedbag BOOLEAN DEFAULT false,
  18. PRIMARY KEY (screenName)
  19. );
  20. -- Ensure clientSideBuddyList table exists (for permit/deny lists)
  21. -- This should already exist from migration 0010, but we'll add IF NOT EXISTS for safety
  22. CREATE TABLE IF NOT EXISTS clientSideBuddyList
  23. (
  24. me VARCHAR(16),
  25. them VARCHAR(16),
  26. isBuddy BOOLEAN DEFAULT false,
  27. isPermit BOOLEAN DEFAULT false,
  28. isDeny BOOLEAN DEFAULT false,
  29. PRIMARY KEY (me, them)
  30. );