-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
-- Source: sql/patch-echo_event-event_variant.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
CREATE TEMPORARY TABLE /*_*/__temp__echo_event AS
SELECT
  event_id,
  event_type,
  event_agent_id,
  event_agent_ip,
  event_extra,
  event_page_id,
  event_deleted
FROM /*_*/echo_event;
DROP TABLE /*_*/echo_event;


CREATE TABLE /*_*/echo_event (
    event_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
    event_type BLOB NOT NULL, event_agent_id INTEGER UNSIGNED DEFAULT NULL,
    event_agent_ip BLOB DEFAULT NULL,
    event_extra BLOB DEFAULT NULL, event_page_id INTEGER UNSIGNED DEFAULT NULL,
    event_deleted SMALLINT UNSIGNED DEFAULT 0 NOT NULL
  );
INSERT INTO /*_*/echo_event (
    event_id, event_type, event_agent_id,
    event_agent_ip, event_extra, event_page_id,
    event_deleted
  )
SELECT
  event_id,
  event_type,
  event_agent_id,
  event_agent_ip,
  event_extra,
  event_page_id,
  event_deleted
FROM
  /*_*/__temp__echo_event;
DROP TABLE /*_*/__temp__echo_event;

CREATE INDEX echo_event_type ON /*_*/echo_event (event_type);

CREATE INDEX echo_event_page_id ON /*_*/echo_event (event_page_id);
