-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
-- Source: schema/abstractSchemaChanges/patch-cusi_signal-add-sis_trigger_id.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
CREATE TEMPORARY TABLE /*_*/__temp__cusi_signal AS
SELECT
  sis_sic_id,
  sis_name,
  sis_value
FROM /*_*/cusi_signal;

DROP TABLE /*_*/cusi_signal;


CREATE TABLE /*_*/cusi_signal (
  sis_sic_id INTEGER UNSIGNED NOT NULL,
  sis_name BLOB NOT NULL,
  sis_value BLOB NOT NULL,
  sis_trigger_id BIGINT UNSIGNED DEFAULT 0 NOT NULL,
  sis_trigger_type SMALLINT DEFAULT 0 NOT NULL,
  PRIMARY KEY(
    sis_name, sis_value, sis_sic_id, sis_trigger_id,
    sis_trigger_type
  )
);

INSERT INTO /*_*/cusi_signal (sis_sic_id, sis_name, sis_value)
SELECT
  sis_sic_id,
  sis_name,
  sis_value
FROM
  /*_*/__temp__cusi_signal;

DROP TABLE /*_*/__temp__cusi_signal;

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