Merge pull request #1784 from garyhgohoos/23593-2
[xtuple] / foundation-database / public / tables / location.sql
1 --ALTER TABLE location ADD COLUMN location_formatname TEXT;
2 --CREATE INDEX location_location_formatname_idx on location using btree (location_formatname);
3
4 --UPDATE location SET location_formatname=formatLocationName(location_id);
5
6
7 select xt.add_column('location','location_formatname', 'TEXT', NULL, 'public');
8 select xt.add_index('location', 'location_formatname','location_location_formatname_idx', 'btree', 'public');
9 UPDATE location SET location_formatname=formatLocationName(location_id) WHERE location_formatname IS NULL;
10
11 -- incident 23507:change how qoh, qoh available, and qoh netable are determined
12 select xt.add_column('location','location_usable', 'BOOLEAN', NULL, 'public');
13 do $$
14 begin
15 if fetchMetricText('ServerVersion') < '4.7.0' then
16   update location set location_usable=true;
17 end if;
18 end$$;