-- This file is automatically generated using maintenance/generateSchemaChangeSql.php.
-- Source: sql/abstractSchemaChanges/patch-logging-rename-indexes.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
CREATE TEMPORARY TABLE /*_*/__temp__logging AS
SELECT
  log_id,
  log_type,
  log_action,
  log_timestamp,
  log_actor,
  log_namespace,
  log_title,
  log_page,
  log_comment_id,
  log_params,
  log_deleted
FROM /*_*/logging;
DROP TABLE /*_*/logging;


CREATE TABLE /*_*/logging (
    log_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
    log_type BLOB DEFAULT '' NOT NULL, log_action BLOB DEFAULT '' NOT NULL,
    log_timestamp BLOB DEFAULT '19700101000000' NOT NULL,
    log_actor BIGINT UNSIGNED NOT NULL,
    log_namespace INTEGER DEFAULT 0 NOT NULL,
    log_title BLOB DEFAULT '' NOT NULL,
    log_page INTEGER UNSIGNED DEFAULT NULL,
    log_comment_id BIGINT UNSIGNED NOT NULL,
    log_params BLOB NOT NULL, log_deleted SMALLINT UNSIGNED DEFAULT 0 NOT NULL
  );
INSERT INTO /*_*/logging (
    log_id, log_type, log_action, log_timestamp,
    log_actor, log_namespace, log_title,
    log_page, log_comment_id, log_params,
    log_deleted
  )
SELECT
  log_id,
  log_type,
  log_action,
  log_timestamp,
  log_actor,
  log_namespace,
  log_title,
  log_page,
  log_comment_id,
  log_params,
  log_deleted
FROM
  /*_*/__temp__logging;
DROP TABLE /*_*/__temp__logging;

CREATE INDEX log_actor_type_time ON /*_*/logging (
    log_actor, log_type, log_timestamp
  );

CREATE INDEX log_page_id_time ON /*_*/logging (log_page, log_timestamp);

CREATE INDEX log_type_action ON /*_*/logging (
    log_type, log_action, log_timestamp
  );

CREATE INDEX log_type_time ON /*_*/logging (log_type, log_timestamp);

CREATE INDEX log_actor_time ON /*_*/logging (log_actor, log_timestamp);

CREATE INDEX log_page_time ON /*_*/logging (
    log_namespace, log_title, log_timestamp
  );

CREATE INDEX log_times ON /*_*/logging (log_timestamp);
