SQL

CREATE TABLE "insights_raw"  (
  "id" integer PRIMARY KEY NOT NULL,
  "metaId" integer NOT NULL,
  "type" integer NOT NULL,
  "value" bigint NOT NULL,
  "timestamp" datetime(0) NOT NULL DEFAULT (CURRENT_TIMESTAMP),
  CONSTRAINT "FK_d66d942bc9907488832eb0eed81" FOREIGN KEY ("metaId") REFERENCES "insights_metadata" ("metaId") ON DELETE CASCADE
)

+ Add column

Columns

Column Data type Allow null Primary key Actions
id INTEGER Rename | Drop
metaId INTEGER Rename | Drop
type INTEGER Rename | Drop
value bigint Rename | Drop
timestamp datetime(0) Rename | Drop

Foreign Keys

Column Destination
metaId insights_metadata.metaId

+ Add index

Indexes

Name Columns Unique SQL Drop?
IDX_insights_raw_timestamp_id
  • timestamp
  • id
SQL
CREATE INDEX "IDX_insights_raw_timestamp_id"
ON "insights_raw" ("timestamp", "id")
Drop