1 -- SPDX-License-Identifier: GPL-2.0-only
 
   3 -- This file is part of Nominatim. (https://nominatim.org)
 
   5 -- Copyright (C) 2022 by the Nominatim developer community.
 
   6 -- For a full list of authors see the git log.
 
   8 DROP TABLE IF EXISTS word;
 
  11   word_token text NOT NULL,
 
  15   country_code varchar(2),
 
  16   search_name_count INTEGER,
 
  18 ) {{db.tablespace.search_data}};
 
  20 CREATE INDEX idx_word_word_token ON word
 
  21     USING BTREE (word_token) {{db.tablespace.search_index}};
 
  22 CREATE INDEX idx_word_word ON word
 
  23     USING BTREE (word) {{db.tablespace.search_index}} WHERE word is not null;
 
  24 GRANT SELECT ON word TO "{{config.DATABASE_WEBUSER}}";
 
  26 DROP SEQUENCE IF EXISTS seq_word;
 
  27 CREATE SEQUENCE seq_word start 1;
 
  28 GRANT SELECT ON seq_word to "{{config.DATABASE_WEBUSER}}";