-- This file is automatically generated using maintenance/generateSchemaSql.php.
-- Source: schema/tables-virtual-checkuser.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
CREATE TABLE /*_*/cusi_case (
  sic_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
  sic_status SMALLINT UNSIGNED DEFAULT 0 NOT NULL,
  sic_status_reason BLOB DEFAULT '' NOT NULL,
  sic_created_timestamp BLOB NOT NULL
);

CREATE UNIQUE INDEX sic_status_created_timestamp_id ON /*_*/cusi_case (
  sic_status, sic_created_timestamp,
  sic_id
);

CREATE UNIQUE INDEX sic_created_timestamp_id ON /*_*/cusi_case (sic_created_timestamp, sic_id);


CREATE TABLE /*_*/cusi_user (
  siu_user_id INTEGER UNSIGNED NOT NULL,
  siu_sic_id INTEGER UNSIGNED NOT NULL,
  PRIMARY KEY(siu_sic_id, siu_user_id)
);

CREATE INDEX siu_user_id ON /*_*/cusi_user (siu_user_id);


CREATE TABLE /*_*/cusi_signal (
  sis_sic_id INTEGER UNSIGNED NOT NULL,
  sis_name BLOB NOT NULL,
  sis_value BLOB NOT NULL,
  PRIMARY KEY(sis_name, sis_value, sis_sic_id)
);

CREATE INDEX sis_sic_id ON /*_*/cusi_signal (sis_sic_id);
