-- This file is automatically generated using maintenance/generateSchemaSql.php.
-- Source: extensions/Wikibase/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 BIGINT UNSIGNED AUTO_INCREMENT NOT NULL,
  wbit_item_id INT UNSIGNED NOT NULL,
  wbit_term_in_lang_id INT UNSIGNED NOT NULL,
  INDEX wbt_item_terms_item_id (wbit_item_id),
  UNIQUE INDEX wbt_item_terms_term_in_lang_id_item_id (
    wbit_term_in_lang_id, wbit_item_id
  ),
  PRIMARY KEY(wbit_id)
) /*$wgDBTableOptions*/;


CREATE TABLE /*_*/wbt_property_terms (
  wbpt_id INT UNSIGNED AUTO_INCREMENT NOT NULL,
  wbpt_property_id INT UNSIGNED NOT NULL,
  wbpt_term_in_lang_id INT UNSIGNED NOT NULL,
  INDEX wbt_property_terms_property_id (wbpt_property_id),
  UNIQUE INDEX wbt_property_terms_term_in_lang_id_property_id (
    wbpt_term_in_lang_id, wbpt_property_id
  ),
  PRIMARY KEY(wbpt_id)
) /*$wgDBTableOptions*/;


CREATE TABLE /*_*/wbt_term_in_lang (
  wbtl_id INT UNSIGNED AUTO_INCREMENT NOT NULL,
  wbtl_type_id INT UNSIGNED NOT NULL,
  wbtl_text_in_lang_id INT UNSIGNED NOT NULL,
  INDEX wbt_term_in_lang_type_id_text_in (wbtl_type_id),
  UNIQUE INDEX wbt_term_in_lang_text_in_lang_id_lang_id (
    wbtl_text_in_lang_id, wbtl_type_id
  ),
  PRIMARY KEY(wbtl_id)
) /*$wgDBTableOptions*/;


CREATE TABLE /*_*/wbt_text_in_lang (
  wbxl_id INT UNSIGNED AUTO_INCREMENT NOT NULL,
  wbxl_language VARBINARY(20) NOT NULL,
  wbxl_text_id INT UNSIGNED NOT NULL,
  INDEX wbt_text_in_lang_language (wbxl_language),
  UNIQUE INDEX wbt_text_in_lang_text_id_text_id (wbxl_text_id, wbxl_language),
  PRIMARY KEY(wbxl_id)
) /*$wgDBTableOptions*/;


CREATE TABLE /*_*/wbt_text (
  wbx_id INT UNSIGNED AUTO_INCREMENT NOT NULL,
  wbx_text VARBINARY(255) NOT NULL,
  UNIQUE INDEX wbt_text_text (wbx_text),
  PRIMARY KEY(wbx_id)
) /*$wgDBTableOptions*/;


CREATE TABLE /*_*/wbt_type (
  wby_id INT UNSIGNED AUTO_INCREMENT NOT NULL,
  wby_name VARBINARY(45) NOT NULL,
  UNIQUE INDEX wbt_type_name (wby_name),
  PRIMARY KEY(wby_id)
) /*$wgDBTableOptions*/;
