-- This file is automatically generated using maintenance/generateSchemaSql.php.
-- Source: repo/sql/abstract/term_store.json
-- Do not modify this file directly.
-- See https://www.mediawiki.org/wiki/Manual:Schema_changes
CREATE TABLE /*_*/wbt_item_terms (
  wbit_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
  wbit_item_id INTEGER UNSIGNED NOT NULL,
  wbit_term_in_lang_id INTEGER UNSIGNED NOT NULL
);

CREATE INDEX wbt_item_terms_item_id ON /*_*/wbt_item_terms (wbit_item_id);

CREATE UNIQUE INDEX wbt_item_terms_term_in_lang_id_item_id ON /*_*/wbt_item_terms (
  wbit_term_in_lang_id, wbit_item_id
);


CREATE TABLE /*_*/wbt_property_terms (
  wbpt_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
  wbpt_property_id INTEGER UNSIGNED NOT NULL,
  wbpt_term_in_lang_id INTEGER UNSIGNED NOT NULL
);

CREATE INDEX wbt_property_terms_property_id ON /*_*/wbt_property_terms (wbpt_property_id);

CREATE UNIQUE INDEX wbt_property_terms_term_in_lang_id_property_id ON /*_*/wbt_property_terms (
  wbpt_term_in_lang_id, wbpt_property_id
);


CREATE TABLE /*_*/wbt_term_in_lang (
  wbtl_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
  wbtl_type_id INTEGER UNSIGNED NOT NULL,
  wbtl_text_in_lang_id INTEGER UNSIGNED NOT NULL
);

CREATE INDEX wbt_term_in_lang_type_id_text_in ON /*_*/wbt_term_in_lang (wbtl_type_id);

CREATE UNIQUE INDEX wbt_term_in_lang_text_in_lang_id_lang_id ON /*_*/wbt_term_in_lang (
  wbtl_text_in_lang_id, wbtl_type_id
);


CREATE TABLE /*_*/wbt_text_in_lang (
  wbxl_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
  wbxl_language BLOB NOT NULL, wbxl_text_id INTEGER UNSIGNED NOT NULL
);

CREATE INDEX wbt_text_in_lang_language ON /*_*/wbt_text_in_lang (wbxl_language);

CREATE UNIQUE INDEX wbt_text_in_lang_text_id_text_id ON /*_*/wbt_text_in_lang (wbxl_text_id, wbxl_language);


CREATE TABLE /*_*/wbt_text (
  wbx_id INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
  wbx_text BLOB NOT NULL
);

CREATE UNIQUE INDEX wbt_text_text ON /*_*/wbt_text (wbx_text);
