SQL

CREATE TABLE `campaign`  (
  `id` text PRIMARY KEY,
  `channel` text NOT NULL,
  `category` text,
  `survey_id` text,
  `created_at` integer DEFAULT (CURRENT_TIMESTAMP),
  `closed_at` integer,
  `replaced_by_id` text,
  `click` integer DEFAULT 0,
  `buy` integer DEFAULT 0,
  `comment` text,
  CONSTRAINT `fk_campaign_survey_id_survey_id_fk` FOREIGN KEY (`survey_id`) REFERENCES `survey`(`id`),
  CONSTRAINT `fk_campaign_replaced_by_id_campaign_id_fk` FOREIGN KEY (`replaced_by_id`) REFERENCES `campaign`(`id`)
)

+ Add column

Columns

Column Data type Allow null Primary key Actions
id TEXT Rename | Drop
channel TEXT Rename | Drop
category TEXT Rename | Drop
survey_id TEXT Rename | Drop
created_at INTEGER Rename | Drop
closed_at INTEGER Rename | Drop
replaced_by_id TEXT Rename | Drop
click INTEGER Rename | Drop
buy INTEGER Rename | Drop
comment TEXT Rename | Drop

Foreign Keys

Column Destination
replaced_by_id campaign.id
survey_id survey.id

+ Add index

Indexes

Name Columns Unique SQL Drop?
sqlite_autoindex_campaign_1 id SQL
-- no sql found --
Drop