]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/sql/Pg/upgrade/0272.schema.identifier-fts-config.sql
Upgrade script numbering for acq order indentifier selector
[working/Evergreen.git] / Open-ILS / src / sql / Pg / upgrade / 0272.schema.identifier-fts-config.sql
1
2 -- No transaction, because any or all of these can fail.  Expect errors!
3
4 INSERT INTO config.upgrade_log (version) VALUES ('0272'); -- miker
5
6 DROP TRIGGER metabib_identifier_field_entry_fti_trigger ON metabib.identifier_field_entry;
7
8 -- 8.3 and beyond
9 CREATE TEXT SEARCH CONFIGURATION identifier ( COPY = title );
10
11 -- 8.2 and before
12 INSERT INTO pg_ts_cfg VALUES ('identifier', 'default','C');
13 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'nlword', '{simple}');
14 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'word', '{simple}');
15 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'email', '{simple}');
16 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'url', '{simple}');
17 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'host', '{simple}');
18 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'sfloat', '{simple}');
19 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'version', '{simple}');
20 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'part_hword', '{simple}');
21 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'nlpart_hword', '{simple}');
22 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'hword', '{simple}');
23 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'nlhword', '{simple}');
24 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'uri', '{simple}');
25 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'file', '{simple}');
26 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'float', '{simple}');
27 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'int', '{simple}');
28 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'uint', '{simple}');
29 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'lword', '{en_stem_nostop}');
30 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'lpart_hword', '{en_stem_nostop}');
31 INSERT INTO pg_ts_cfgmap VALUES ('identifier', 'lhword', '{en_stem_nostop}');
32
33
34 CREATE TRIGGER metabib_identifier_field_entry_fti_trigger
35     BEFORE UPDATE OR INSERT ON metabib.identifier_field_entry
36     FOR EACH ROW EXECUTE PROCEDURE oils_tsearch2('identifier');
37