Project

General

Profile

« Previous | Next » 

Revision 12253

schemas/vegbien.sql: schema_null params: use schema_anchor instead of source for this, since it is guaranteed to exist regardless of which tables are in the VegBIEN schema

View differences:

trunk/schemas/vegbien.my.sql
358 358

  
359 359

  
360 360

  
361

  
362

  
363

  
364

  
365 361
--
366
-- Name: source; Type: TABLE; Schema: public; Owner: -; Tablespace: 
367
--
368

  
369
CREATE TABLE source (
370
    source_id int(11) NOT NULL,
371
    matched_source_id int(11),
372
    parent_id int(11),
373
    shortname varchar(255) NOT NULL,
374
    citation varchar(255),
375
    sourcetype varchar(255),
376
    accesslevel varchar(255),
377
    accessconditions varchar(255),
378
    observationtype varchar(255),
379
    title varchar(255),
380
    titlesuperior varchar(255),
381
    volume varchar(255),
382
    issue varchar(255),
383
    pagerange varchar(255),
384
    totalpages int(11),
385
    publisher varchar(255),
386
    publicationplace varchar(255),
387
    isbn varchar(255),
388
    edition varchar(255),
389
    numberofvolumes int(11),
390
    chapternumber int(11),
391
    reportnumber int(11),
392
    communicationtype varchar(255),
393
    degree varchar(255),
394
    url varchar(255),
395
    doi varchar(255),
396
    additionalinfo varchar(255),
397
    pubdate date,
398
    accessdate date,
399
    conferencedate date,
400
    datecreated date  NOT NULL,
401
    createdby varchar(255),
402
    datelastmodified date  NOT NULL,
403
    lastmodifiedby varchar(255),
404
    import_revision varchar(255)
405
);
406

  
407

  
408
--
409 362
-- Name: datasource_publish(varchar(255), anyelement); Type: FUNCTION; Schema: public; Owner: -
410 363
--
411 364

  
......
580 533

  
581 534

  
582 535

  
536

  
537

  
538

  
539

  
583 540
--
584 541
-- Name: place; Type: TABLE; Schema: public; Owner: -; Tablespace: 
585 542
--
......
1578 1535

  
1579 1536

  
1580 1537
--
1538
-- Name: source; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1539
--
1540

  
1541
CREATE TABLE source (
1542
    source_id int(11) NOT NULL,
1543
    matched_source_id int(11),
1544
    parent_id int(11),
1545
    shortname varchar(255) NOT NULL,
1546
    citation varchar(255),
1547
    sourcetype varchar(255),
1548
    accesslevel varchar(255),
1549
    accessconditions varchar(255),
1550
    observationtype varchar(255),
1551
    title varchar(255),
1552
    titlesuperior varchar(255),
1553
    volume varchar(255),
1554
    issue varchar(255),
1555
    pagerange varchar(255),
1556
    totalpages int(11),
1557
    publisher varchar(255),
1558
    publicationplace varchar(255),
1559
    isbn varchar(255),
1560
    edition varchar(255),
1561
    numberofvolumes int(11),
1562
    chapternumber int(11),
1563
    reportnumber int(11),
1564
    communicationtype varchar(255),
1565
    degree varchar(255),
1566
    url varchar(255),
1567
    doi varchar(255),
1568
    additionalinfo varchar(255),
1569
    pubdate date,
1570
    accessdate date,
1571
    conferencedate date,
1572
    datecreated date  NOT NULL,
1573
    createdby varchar(255),
1574
    datelastmodified date  NOT NULL,
1575
    lastmodifiedby varchar(255),
1576
    import_revision varchar(255)
1577
);
1578

  
1579

  
1580
--
1581 1581
-- Name: stratum; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1582 1582
--
1583 1583

  
......
9380 9380

  
9381 9381

  
9382 9382
--
9383
-- Name: source; Type: ACL; Schema: public; Owner: -
9384
--
9385

  
9386

  
9387

  
9388

  
9389

  
9390

  
9391

  
9392

  
9393
--
9394 9383
-- Name: place; Type: ACL; Schema: public; Owner: -
9395 9384
--
9396 9385

  
......
9572 9561

  
9573 9562

  
9574 9563
--
9564
-- Name: source; Type: ACL; Schema: public; Owner: -
9565
--
9566

  
9567

  
9568

  
9569

  
9570

  
9571

  
9572

  
9573

  
9574
--
9575 9575
-- Name: stratum; Type: ACL; Schema: public; Owner: -
9576 9576
--
9577 9577

  
trunk/schemas/vegbien.sql
711 711
$_$;
712 712

  
713 713

  
714
SET default_tablespace = '';
715

  
716
SET default_with_oids = false;
717

  
718 714
--
719
-- Name: source; Type: TABLE; Schema: public; Owner: -; Tablespace: 
720
--
721

  
722
CREATE TABLE source (
723
    source_id integer NOT NULL,
724
    matched_source_id integer,
725
    parent_id integer,
726
    shortname text NOT NULL,
727
    citation text,
728
    sourcetype sourcetype,
729
    accesslevel accesslevel,
730
    accessconditions text,
731
    observationtype observationtype,
732
    title text,
733
    titlesuperior text,
734
    volume text,
735
    issue text,
736
    pagerange text,
737
    totalpages integer,
738
    publisher text,
739
    publicationplace text,
740
    isbn text,
741
    edition text,
742
    numberofvolumes integer,
743
    chapternumber integer,
744
    reportnumber integer,
745
    communicationtype text,
746
    degree text,
747
    url text,
748
    doi text,
749
    additionalinfo text,
750
    pubdate date,
751
    accessdate date,
752
    conferencedate date,
753
    datecreated date DEFAULT now() NOT NULL,
754
    createdby text,
755
    datelastmodified date DEFAULT now() NOT NULL,
756
    lastmodifiedby text,
757
    import_revision text
758
);
759

  
760

  
761
--
762 715
-- Name: datasource_publish(text, anyelement); Type: FUNCTION; Schema: public; Owner: -
763 716
--
764 717

  
765
CREATE FUNCTION datasource_publish(datasource text, schema_null anyelement DEFAULT NULL::source) RETURNS void
718
CREATE FUNCTION datasource_publish(datasource text, schema_null anyelement DEFAULT NULL::schema_anchor) RETURNS void
766 719
    LANGUAGE plpgsql
767 720
    AS $$
768 721
DECLARE
......
794 747
-- Name: datasource_rename(text, text, anyelement); Type: FUNCTION; Schema: public; Owner: -
795 748
--
796 749

  
797
CREATE FUNCTION datasource_rename(old text, new text, schema_null anyelement DEFAULT NULL::source) RETURNS void
750
CREATE FUNCTION datasource_rename(old text, new text, schema_null anyelement DEFAULT NULL::schema_anchor) RETURNS void
798 751
    LANGUAGE sql
799 752
    AS $_$
800 753
SELECT set_config('search_path', util.schema_esc($3), true);
......
817 770
-- Name: datasource_rm(text, anyelement); Type: FUNCTION; Schema: public; Owner: -
818 771
--
819 772

  
820
CREATE FUNCTION datasource_rm(datasource text, schema_null anyelement DEFAULT NULL::source) RETURNS void
773
CREATE FUNCTION datasource_rm(datasource text, schema_null anyelement DEFAULT NULL::schema_anchor) RETURNS void
821 774
    LANGUAGE sql
822 775
    AS $_$
823 776
SELECT set_config('search_path', util.schema_esc($2), true);
......
850 803
-- Name: datasource_unpublish(text, anyelement); Type: FUNCTION; Schema: public; Owner: -
851 804
--
852 805

  
853
CREATE FUNCTION datasource_unpublish(datasource text, schema_null anyelement DEFAULT NULL::source) RETURNS void
806
CREATE FUNCTION datasource_unpublish(datasource text, schema_null anyelement DEFAULT NULL::schema_anchor) RETURNS void
854 807
    LANGUAGE sql
855 808
    AS $_$
856 809
SELECT set_config('search_path', util.schema_esc($3), true);
......
1156 1109
$$;
1157 1110

  
1158 1111

  
1112
SET default_tablespace = '';
1113

  
1114
SET default_with_oids = false;
1115

  
1159 1116
--
1160 1117
-- Name: place; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1161 1118
--
......
1382 1339
-- Name: publish(anyelement); Type: FUNCTION; Schema: public; Owner: -
1383 1340
--
1384 1341

  
1385
CREATE FUNCTION publish(schema_null anyelement DEFAULT NULL::source) RETURNS void
1342
CREATE FUNCTION publish(schema_null anyelement DEFAULT NULL::schema_anchor) RETURNS void
1386 1343
    LANGUAGE plpgsql
1387 1344
    AS $$
1388 1345
BEGIN
......
1413 1370
-- Name: rm(anyelement); Type: FUNCTION; Schema: public; Owner: -
1414 1371
--
1415 1372

  
1416
CREATE FUNCTION rm(schema_null anyelement DEFAULT NULL::source) RETURNS void
1373
CREATE FUNCTION rm(schema_null anyelement DEFAULT NULL::schema_anchor) RETURNS void
1417 1374
    LANGUAGE plpgsql
1418 1375
    AS $$
1419 1376
BEGIN
......
2828 2785

  
2829 2786

  
2830 2787
--
2788
-- Name: source; Type: TABLE; Schema: public; Owner: -; Tablespace: 
2789
--
2790

  
2791
CREATE TABLE source (
2792
    source_id integer NOT NULL,
2793
    matched_source_id integer,
2794
    parent_id integer,
2795
    shortname text NOT NULL,
2796
    citation text,
2797
    sourcetype sourcetype,
2798
    accesslevel accesslevel,
2799
    accessconditions text,
2800
    observationtype observationtype,
2801
    title text,
2802
    titlesuperior text,
2803
    volume text,
2804
    issue text,
2805
    pagerange text,
2806
    totalpages integer,
2807
    publisher text,
2808
    publicationplace text,
2809
    isbn text,
2810
    edition text,
2811
    numberofvolumes integer,
2812
    chapternumber integer,
2813
    reportnumber integer,
2814
    communicationtype text,
2815
    degree text,
2816
    url text,
2817
    doi text,
2818
    additionalinfo text,
2819
    pubdate date,
2820
    accessdate date,
2821
    conferencedate date,
2822
    datecreated date DEFAULT now() NOT NULL,
2823
    createdby text,
2824
    datelastmodified date DEFAULT now() NOT NULL,
2825
    lastmodifiedby text,
2826
    import_revision text
2827
);
2828

  
2829

  
2830
--
2831 2831
-- Name: stratum; Type: TABLE; Schema: public; Owner: -; Tablespace: 
2832 2832
--
2833 2833

  
......
11558 11558

  
11559 11559

  
11560 11560
--
11561
-- Name: source; Type: ACL; Schema: public; Owner: -
11562
--
11563

  
11564
REVOKE ALL ON TABLE source FROM PUBLIC;
11565
REVOKE ALL ON TABLE source FROM bien;
11566
GRANT ALL ON TABLE source TO bien;
11567
GRANT SELECT ON TABLE source TO bien_read;
11568
GRANT SELECT ON TABLE source TO public_;
11569

  
11570

  
11571
--
11572 11561
-- Name: place; Type: ACL; Schema: public; Owner: -
11573 11562
--
11574 11563

  
......
11750 11739

  
11751 11740

  
11752 11741
--
11742
-- Name: source; Type: ACL; Schema: public; Owner: -
11743
--
11744

  
11745
REVOKE ALL ON TABLE source FROM PUBLIC;
11746
REVOKE ALL ON TABLE source FROM bien;
11747
GRANT ALL ON TABLE source TO bien;
11748
GRANT SELECT ON TABLE source TO bien_read;
11749
GRANT SELECT ON TABLE source TO public_;
11750

  
11751

  
11752
--
11753 11753
-- Name: stratum; Type: ACL; Schema: public; Owner: -
11754 11754
--
11755 11755

  

Also available in: Unified diff