SQL

CREATE TABLE instagram_connections  (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  chatbot_id INTEGER NOT NULL,
  connection_name TEXT NOT NULL,
  openai_api_key TEXT,
  page_id TEXT,
  instagram_business_account_id TEXT,
  access_token TEXT,
  token_expires_at TEXT,
  is_active INTEGER DEFAULT 1,
  created_at TEXT NOT NULL,
  updated_at TEXT,
  agent_enabled INTEGER DEFAULT 1,
  FOREIGN KEY (chatbot_id) REFERENCES chatbots(id) ON DELETE CASCADE,
  UNIQUE(chatbot_id, connection_name)
)

+ Add column

Columns

Column Data type Allow null Primary key Actions
id INTEGER Rename | Drop
chatbot_id INTEGER Rename | Drop
connection_name TEXT Rename | Drop
openai_api_key TEXT Rename | Drop
page_id TEXT Rename | Drop
instagram_business_account_id TEXT Rename | Drop
access_token TEXT Rename | Drop
token_expires_at TEXT Rename | Drop
is_active INTEGER Rename | Drop
created_at TEXT Rename | Drop
updated_at TEXT Rename | Drop
agent_enabled INTEGER Rename | Drop

Foreign Keys

Column Destination
chatbot_id chatbots.id

+ Add index

Indexes

Name Columns Unique SQL Drop?
sqlite_autoindex_instagram_connections_1
  • chatbot_id
  • connection_name
SQL
-- no sql found --
Drop