Project

General

Profile

« Previous | Next » 

Revision 2159

schemas/vegbien.sql: Added _toGrowthform

View differences:

schemas/vegbien.my.sql
82 82

  
83 83

  
84 84
--
85
-- Name: _toGrowthform(); Type: FUNCTION; Schema: public; Owner: -
86
--
87

  
88

  
89

  
90

  
91
--
85 92
-- Name: aggregateoccurrence_plantobs_count_1(); Type: FUNCTION; Schema: public; Owner: -
86 93
--
87 94

  
......
114 121

  
115 122

  
116 123
--
124
-- Name: _toGrowthform; Type: TABLE; Schema: public; Owner: -; Tablespace: 
125
--
126

  
127
CREATE TABLE `_toGrowthform` (
128
    result text,
129
    value text
130
);
131

  
132

  
133

  
134

  
135
--
117 136
-- Name: address; Type: TABLE; Schema: public; Owner: -; Tablespace: 
118 137
--
119 138

  
......
3639 3658

  
3640 3659

  
3641 3660
--
3661
-- Name: _toGrowthform_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3662
--
3663

  
3664

  
3665

  
3666

  
3667
--
3642 3668
-- Name: address_organization_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
3643 3669
--
3644 3670

  
......
4752 4778

  
4753 4779

  
4754 4780
--
4781
-- Name: _toGrowthform; Type: TRIGGER; Schema: public; Owner: -
4782
--
4783

  
4784

  
4785

  
4786

  
4787
--
4755 4788
-- Name: aggregateoccurrence_plantobs_count_1; Type: TRIGGER; Schema: public; Owner: -
4756 4789
--
4757 4790

  
schemas/vegbien.sql
178 178

  
179 179

  
180 180
--
181
-- Name: _toGrowthform(); Type: FUNCTION; Schema: public; Owner: -
182
--
183

  
184
CREATE FUNCTION "_toGrowthform"() RETURNS trigger
185
    LANGUAGE plpgsql IMMUTABLE
186
    AS $$
187
BEGIN
188
    new.result := CAST(new.value AS growthform);
189
    RETURN new;
190
END;
191
$$;
192

  
193

  
194
--
181 195
-- Name: aggregateoccurrence_plantobs_count_1(); Type: FUNCTION; Schema: public; Owner: -
182 196
--
183 197

  
......
306 320

  
307 321
SET default_tablespace = '';
308 322

  
323
SET default_with_oids = false;
324

  
325
--
326
-- Name: _toGrowthform; Type: TABLE; Schema: public; Owner: -; Tablespace: 
327
--
328

  
329
CREATE TABLE "_toGrowthform" (
330
    result growthform,
331
    value text
332
);
333

  
334

  
309 335
SET default_with_oids = true;
310 336

  
311 337
--
......
4166 4192

  
4167 4193

  
4168 4194
--
4195
-- Name: _toGrowthform_unique; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4196
--
4197

  
4198
CREATE UNIQUE INDEX "_toGrowthform_unique" ON "_toGrowthform" USING btree ((COALESCE(value, '\\N'::text)));
4199

  
4200

  
4201
--
4169 4202
-- Name: address_organization_id_x; Type: INDEX; Schema: public; Owner: -; Tablespace: 
4170 4203
--
4171 4204

  
......
5279 5312

  
5280 5313

  
5281 5314
--
5315
-- Name: _toGrowthform; Type: TRIGGER; Schema: public; Owner: -
5316
--
5317

  
5318
CREATE TRIGGER "_toGrowthform" BEFORE INSERT OR UPDATE ON "_toGrowthform" FOR EACH ROW EXECUTE PROCEDURE "_toGrowthform"();
5319

  
5320

  
5321
--
5282 5322
-- Name: aggregateoccurrence_plantobs_count_1; Type: TRIGGER; Schema: public; Owner: -
5283 5323
--
5284 5324

  

Also available in: Unified diff