local
[webpac2] / conf / dipl / schema.sql
index eb784c7..a1a5d0d 100644 (file)
@@ -2,6 +2,7 @@ drop view if exists parovi;
 drop view if exists rpcou;
 drop view if exists citingu;
 drop view if exists citiraniu;
+drop view if exists radoviu;
 
 drop table if exists utca;
 create table utca (
@@ -32,10 +33,37 @@ create table authors (
        ca text
 );
 
+drop table if exists radovi;
+create table radovi (
+       ca text,
+       ut text,
+       pt text,
+       au text,
+       af text,
+       ti text,
+       so text,
+       la text,
+       dt text,
+       de text,
+       id text,
+       c1 text,
+       rp text,
+       nr integer,
+       tc integer,
+       pi text,
+       py integer,
+       di text,
+       sc text
+);
+
+drop table if exists radoviau;
+create table radoviau (
+       ut text,
+       au text
+);
 
 drop table if exists citing;
 create table citing (
-       id serial,
        ut text,
        pt text,
        au text,
@@ -44,6 +72,8 @@ create table citing (
        so text,
        la text,
        dt text,
+       de text,
+       id text,
        c1 text,
        rp text,
        nr integer,
@@ -71,18 +101,20 @@ create table citirani (
        cr_year text,
        cr_vol text,
        cr_page text,
-       ttc integer,
-       cr text,
-       can text,
-       isi text
+       catc integer,
+       cr_full text,
+       isi text,
+       camb integer
 );
 
 create view citingu as select distinct ut,pt,au,so,la,dt,nr,tc,pi,py,di,sc,rp from citing ;
 
+create view radoviu as select distinct ut,pt,au,so,la,dt,nr,tc,pi,py,di,sc,rp from radovi ;
+
 create view rpcou as select distinct * from rpco ;
 
 create view parovi as select distinct citirani.ca,
-       citirani.cr,
+       citirani.cr_full as cr,
         cited.cr_full,
         cited.ut,
        citingu.pt,
@@ -97,12 +129,12 @@ create view parovi as select distinct citirani.ca,
        citingu.sc,
        citingu.rp
 from citirani
-left join cited on citirani.cr = cited.cr_full
+left join cited on citirani.cr_full = cited.cr_full
 left join citingu on cited.ut = citingu.ut
 left join rpcou on cited.ut = rpcou.ut
 ;
 
-create view citiraniu as select distinct cr_auth,cr_ref,cr_year,cr_vol,cr_page,ttc,cr,isi from citirani ;
+create view citiraniu as select distinct cr_auth,cr_ref,cr_year,cr_vol,cr_page,catc,cr_full,isi from citirani ;
 
 
 drop table if exists cropsy;