Project

General

Profile

« Previous | Next » 

Revision 12412

fix: schemas/vegbien.sql: public_validations._plots_* that use projectname: re-alias to project_name to match input queries. (reexporting apparently changes the relative order of the ~type tables.)

View differences:

trunk/schemas/vegbien.my.sql
1021 1021

  
1022 1022

  
1023 1023

  
1024
--
1025
-- Name: ~type._plots_01_count_of_projects; Type: TABLE; Schema: public_validations; Owner: -; Tablespace: 
1026
--
1027 1024

  
1028
CREATE TABLE `~type._plots_01_count_of_projects` (
1029
    projects varchar(255)
1030
);
1031 1025

  
1032

  
1033 1026
--
1034
-- Name: ~type._plots_02_list_of_project_names; Type: TABLE; Schema: public_validations; Owner: -; Tablespace: 
1035
--
1036

  
1037
CREATE TABLE `~type._plots_02_list_of_project_names` (
1038
    projectname varchar(255)
1039
);
1040

  
1041

  
1042
--
1043
-- Name: ~type._plots_03_count_of_all_plots_in_this_source; Type: TABLE; Schema: public_validations; Owner: -; Tablespace: 
1044
--
1045

  
1046
CREATE TABLE `~type._plots_03_count_of_all_plots_in_this_source` (
1047
    plots varchar(255)
1048
);
1049

  
1050

  
1051

  
1052

  
1053
--
1054 1027
-- Name: analytical_stem; Type: TABLE; Schema: public; Owner: -; Tablespace: 
1055 1028
--
1056 1029

  
......
3862 3835

  
3863 3836

  
3864 3837
--
3838
-- Name: ~type._plots_01_count_of_projects; Type: TABLE; Schema: public_validations; Owner: -; Tablespace: 
3839
--
3840

  
3841
CREATE TABLE `~type._plots_01_count_of_projects` (
3842
    projects varchar(255)
3843
);
3844

  
3845

  
3846
--
3847
-- Name: ~type._plots_02_list_of_project_names; Type: TABLE; Schema: public_validations; Owner: -; Tablespace: 
3848
--
3849

  
3850
CREATE TABLE `~type._plots_02_list_of_project_names` (
3851
    projectname varchar(255)
3852
);
3853

  
3854

  
3855
--
3856
-- Name: ~type._plots_03_count_of_all_plots_in_this_source; Type: TABLE; Schema: public_validations; Owner: -; Tablespace: 
3857
--
3858

  
3859
CREATE TABLE `~type._plots_03_count_of_all_plots_in_this_source` (
3860
    plots varchar(255)
3861
);
3862

  
3863

  
3864
--
3865 3865
-- Name: ~type._traits_01_count_records; Type: TABLE; Schema: public_validations; Owner: -; Tablespace: 
3866 3866
--
3867 3867

  
trunk/schemas/vegbien.sql
2349 2349
$_$;
2350 2350

  
2351 2351

  
2352
--
2353
-- Name: ~type._plots_01_count_of_projects; Type: TABLE; Schema: public_validations; Owner: -; Tablespace: 
2354
--
2355

  
2356
CREATE TABLE "~type._plots_01_count_of_projects" (
2357
    projects bigint
2358
);
2359

  
2360

  
2361
--
2362
-- Name: ~type._plots_02_list_of_project_names; Type: TABLE; Schema: public_validations; Owner: -; Tablespace: 
2363
--
2364

  
2365
CREATE TABLE "~type._plots_02_list_of_project_names" (
2366
    projectname text
2367
);
2368

  
2369

  
2370
--
2371
-- Name: ~type._plots_03_count_of_all_plots_in_this_source; Type: TABLE; Schema: public_validations; Owner: -; Tablespace: 
2372
--
2373

  
2374
CREATE TABLE "~type._plots_03_count_of_all_plots_in_this_source" (
2375
    plots bigint
2376
);
2377

  
2378

  
2379 2352
SET search_path = public, pg_catalog;
2380 2353

  
2381 2354
--
......
5864 5837
--
5865 5838

  
5866 5839
CREATE VIEW _plots_02_list_of_project_names AS
5867
 SELECT p.projectname
5840
 SELECT p.projectname AS project_name
5868 5841
   FROM (public.project p
5869 5842
   JOIN public.source s ON ((p.source_id = s.source_id)))
5870 5843
  WHERE (s.shortname = ("current_schema"())::text);
......
5888 5861
--
5889 5862

  
5890 5863
CREATE VIEW _plots_04_count_of_plots_in_each_project_in_this_source AS
5891
 SELECT p.projectname, 
5864
 SELECT p.projectname AS project_name, 
5892 5865
    count(DISTINCT l.location_id) AS plots
5893 5866
   FROM (((public.location l
5894 5867
   JOIN public.locationevent le ON ((l.location_id = le.location_id)))
......
5903 5876
--
5904 5877

  
5905 5878
CREATE VIEW _plots_05_list_of_plot_codes_by_project AS
5906
 SELECT p.projectname, 
5879
 SELECT p.projectname AS project_name, 
5907 5880
    l.authorlocationcode AS "plotCode"
5908 5881
   FROM (((public.location l
5909 5882
   JOIN public.locationevent le ON ((l.location_id = le.location_id)))
......
5936 5909
--
5937 5910

  
5938 5911
CREATE VIEW _plots_10_count_of_individuals_per_plot_in_each_project AS
5939
 SELECT p.projectname, 
5912
 SELECT p.projectname AS project_name, 
5940 5913
    l.authorlocationcode AS plotcode, 
5941 5914
    sum(ao.count) AS individuals
5942 5915
   FROM ((((((public.project p
......
5967 5940
--
5968 5941

  
5969 5942
CREATE VIEW _plots_11_count_of_stems_per_plot_in_each_project AS
5970
 SELECT p.projectname, 
5943
 SELECT p.projectname AS project_name, 
5971 5944
    l.authorlocationcode AS plotcode, 
5972 5945
    count(DISTINCT so.stemobservation_id) AS stems
5973 5946
   FROM ((((((((public.project p
......
5998 5971
--
5999 5972

  
6000 5973
CREATE VIEW _plots_12_count_of_verbatim_taxa_per_plot_in_each_project AS
6001
 SELECT p.projectname, 
5974
 SELECT p.projectname AS project_name, 
6002 5975
    l.authorlocationcode AS plotcode, 
6003 5976
    count(DISTINCT btrim((((((((''::text || COALESCE(tv.family, ''::text)) || ' '::text) || COALESCE(tv.genus, ''::text)) || ' '::text) || COALESCE(tv.specific_epithet, ''::text)) || ' '::text) || COALESCE(tv.morphospecies, ''::text)))) AS taxa
6004 5977
   FROM (((((((public.project p
......
6030 6003
--
6031 6004

  
6032 6005
CREATE VIEW _plots_13_list_of_distinct_verbatim_taxa_in_each_plot_in_each_p AS
6033
 SELECT DISTINCT p.projectname, 
6006
 SELECT DISTINCT p.projectname AS project_name, 
6034 6007
    l.authorlocationcode AS plotcode, 
6035 6008
    btrim((((((((''::text || COALESCE(tv.family, ''::text)) || ' '::text) || COALESCE(tv.genus, ''::text)) || ' '::text) || COALESCE(tv.specific_epithet, ''::text)) || ' '::text) || COALESCE(tv.morphospecies, ''::text))) AS taxon
6036 6009
   FROM (((((((public.project p
......
6059 6032
--
6060 6033

  
6061 6034
CREATE VIEW _plots_14_count_of_indiv_per_verbatim_taxon_per_plot_in_each_pr AS
6062
 SELECT DISTINCT p.projectname, 
6035
 SELECT DISTINCT p.projectname AS project_name, 
6063 6036
    l.authorlocationcode AS plotcode, 
6064 6037
    btrim((((((((''::text || COALESCE(tv.family, ''::text)) || ' '::text) || COALESCE(tv.genus, ''::text)) || ' '::text) || COALESCE(tv.specific_epithet, ''::text)) || ' '::text) || COALESCE(tv.morphospecies, ''::text))) AS taxon, 
6065 6038
    sum(ao.count) AS individuals
......
6091 6064
--
6092 6065

  
6093 6066
CREATE VIEW _plots_15_pct_cover_of_each_verb_taxon_in_each_plot_in_each_pro AS
6094
 SELECT DISTINCT p.projectname, 
6067
 SELECT DISTINCT p.projectname AS project_name, 
6095 6068
    l.authorlocationcode AS plotcode, 
6096 6069
    btrim((((((((''::text || COALESCE(tv.family, ''::text)) || ' '::text) || COALESCE(tv.genus, ''::text)) || ' '::text) || COALESCE(tv.specific_epithet, ''::text)) || ' '::text) || COALESCE(tv.morphospecies, ''::text))) AS taxon, 
6097 6070
    sum(ci.coverpercent) AS totalpercentcover
......
6127 6100
--
6128 6101

  
6129 6102
CREATE VIEW _plots_17_count_of_subplots_per_plot_for_each_project AS
6130
 SELECT p.projectname, 
6103
 SELECT p.projectname AS project_name, 
6131 6104
    l.authorlocationcode AS plotcode, 
6132 6105
    count(DISTINCT sub_locationevent.locationevent_id) AS subplots
6133 6106
   FROM ((((public.project p
......
6145 6118
--
6146 6119

  
6147 6120
CREATE VIEW _plots_18_list_of_subplots_codes_for_each_plot_for_each_project AS
6148
 SELECT p.projectname, 
6121
 SELECT p.projectname AS project_name, 
6149 6122
    l.authorlocationcode AS plotcode, 
6150 6123
    sub_locationevent.authoreventcode AS "subplotCode"
6151 6124
   FROM ((((public.project p
......
6291 6264

  
6292 6265

  
6293 6266
--
6267
-- Name: ~type._plots_01_count_of_projects; Type: TABLE; Schema: public_validations; Owner: -; Tablespace: 
6268
--
6269

  
6270
CREATE TABLE "~type._plots_01_count_of_projects" (
6271
    projects bigint
6272
);
6273

  
6274

  
6275
--
6276
-- Name: ~type._plots_02_list_of_project_names; Type: TABLE; Schema: public_validations; Owner: -; Tablespace: 
6277
--
6278

  
6279
CREATE TABLE "~type._plots_02_list_of_project_names" (
6280
    projectname text
6281
);
6282

  
6283

  
6284
--
6285
-- Name: ~type._plots_03_count_of_all_plots_in_this_source; Type: TABLE; Schema: public_validations; Owner: -; Tablespace: 
6286
--
6287

  
6288
CREATE TABLE "~type._plots_03_count_of_all_plots_in_this_source" (
6289
    plots bigint
6290
);
6291

  
6292

  
6293
--
6294 6294
-- Name: ~type._traits_01_count_records; Type: TABLE; Schema: public_validations; Owner: -; Tablespace: 
6295 6295
--
6296 6296

  

Also available in: Unified diff