SQL

CREATE TABLE communication_comments  (
  id INTEGER PRIMARY KEY AUTOINCREMENT,
  communication_id INTEGER NOT NULL REFERENCES communications(id) ON DELETE CASCADE,
  comment TEXT NOT NULL,
  link TEXT,
  created_by INTEGER REFERENCES users(id),
  created_at TEXT NOT NULL DEFAULT (datetime('now','localtime'))
)

+ Add column

Columns

Column Data type Allow null Primary key Actions
id INTEGER Rename | Drop
communication_id INTEGER Rename | Drop
comment TEXT Rename | Drop
link TEXT Rename | Drop
created_by INTEGER Rename | Drop
created_at TEXT Rename | Drop

Foreign Keys

Column Destination
created_by users.id
communication_id communications.id

+ Add index

Indexes

Name Columns Unique SQL Drop?