CREATE TABLE IF NOT EXISTS settings (
  skey VARCHAR(191) PRIMARY KEY,
  svalue JSON,
  updated_at DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);
CREATE TABLE IF NOT EXISTS workspaces (
 id INT AUTO_INCREMENT PRIMARY KEY,
 name VARCHAR(255),
 owner_id INT,
 created_at DATETIME DEFAULT CURRENT_TIMESTAMP
);
-- Additional indexes for performance (88)
CREATE INDEX idx_link_published ON link_library(published_date);
CREATE INDEX idx_queue_account ON publish_queue(account_id);
-- UTM settings
INSERT IGNORE INTO settings (skey,svalue) VALUES ('utm', '{"enabled":false,"source":"socialhub","medium":"social","campaign":"auto"}');
INSERT IGNORE INTO settings (skey,svalue) VALUES ('crawl', '{"interval":15,"batch_size":50,"timeout":15,"retry":3}');
