-- This file is automatically generated using maintenance/generateSchemaSql.php.
-- Source: sql/tables.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
CREATE TABLE /*_*/globaljsonlinks_target (
  gjlt_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
  gjlt_namespace INTEGER NOT NULL, gjlt_title BLOB NOT NULL
);

CREATE UNIQUE INDEX gjlt_namespace_title ON /*_*/globaljsonlinks_target (gjlt_namespace, gjlt_title);


CREATE TABLE /*_*/globaljsonlinks_wiki (
  gjlw_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
  gjlw_wiki BLOB NOT NULL, gjlw_namespace INTEGER DEFAULT NULL,
  gjlw_namespace_text BLOB DEFAULT NULL
);

CREATE UNIQUE INDEX gjlw_wiki_id_namespace ON /*_*/globaljsonlinks_wiki (
  gjlw_wiki, gjlw_namespace, gjlw_namespace_text
);


CREATE TABLE /*_*/globaljsonlinks (
  gjl_wiki INTEGER NOT NULL,
  gjl_namespace INTEGER NOT NULL,
  gjl_title BLOB NOT NULL,
  gjl_target BIGINT UNSIGNED NOT NULL,
  PRIMARY KEY(
    gjl_wiki, gjl_namespace, gjl_title,
    gjl_target
  )
);

CREATE INDEX gjl_target_namespace_title ON /*_*/globaljsonlinks (
  gjl_target, gjl_wiki, gjl_namespace,
  gjl_title
);
