Changeset 7655


Ignore:
Timestamp:
25/10/10 16:53:16 (9 years ago)
Author:
mnagni
Message:

Insert the tables for the Timer service and the trigger to handle how remove a provider from the the services

Location:
TI01-discovery-Ingest/trunk/v4.3.0/ingestAutomation-upgrade/ingestLoggingDatabase
Files:
4 added
6 edited

Legend:

Unmodified
Added
Removed
  • TI01-discovery-Ingest/trunk/v4.3.0/ingestAutomation-upgrade/ingestLoggingDatabase/CSWProvider.sql

    r7409 r7655  
    99  type_names character varying, 
    1010  CONSTRAINT csw_provider_pkey PRIMARY KEY (common_id), 
    11   CONSTRAINT csw_provider_common_id_fkey FOREIGN KEY (common_id) 
     11  CONSTRAINT csw_provider_idkey FOREIGN KEY (common_id) 
    1212      REFERENCES provider_common (id) MATCH SIMPLE 
    13       ON UPDATE NO ACTION ON DELETE NO ACTION 
     13      ON UPDATE NO ACTION ON DELETE CASCADE 
    1414) 
    1515WITH ( 
  • TI01-discovery-Ingest/trunk/v4.3.0/ingestAutomation-upgrade/ingestLoggingDatabase/IngestProblemFileTable.sql

    r7363 r7655  
    55 *  
    66 */ 
    7 DROP TABLE ingest_logging_problem_files CASCADE; 
    8 CREATE TABLE ingest_logging_problem_files ( 
    9     problem_file_id SERIAL primary key, --id assigned by postgres 
    10         id int4, --process id 
    11         problem_file_name text, --name of problem file 
    12         problem_file_message text --error associated with problem file   
     7CREATE TABLE ingest_logging_problem_files 
     8( 
     9  problem_file_id serial NOT NULL, 
     10  id integer, 
     11  problem_file_name text, 
     12  problem_file_message text, 
     13  CONSTRAINT ingest_logging_problem_files_pkey PRIMARY KEY (problem_file_id) 
     14) 
     15WITH ( 
     16  OIDS=FALSE 
    1317); 
     18ALTER TABLE ingest_logging_problem_files OWNER TO badc; 
  • TI01-discovery-Ingest/trunk/v4.3.0/ingestAutomation-upgrade/ingestLoggingDatabase/OAIProvider.sql

    r7409 r7655  
    1010  common_id integer NOT NULL DEFAULT -1, 
    1111  CONSTRAINT oai_provider_pkey PRIMARY KEY (common_id), 
    12   CONSTRAINT oai_provider_common_id_fkey FOREIGN KEY (common_id) 
     12  CONSTRAINT oai_common_idkey FOREIGN KEY (common_id) 
    1313      REFERENCES provider_common (id) MATCH SIMPLE 
    14       ON UPDATE NO ACTION ON DELETE NO ACTION 
     14      ON UPDATE NO ACTION ON DELETE CASCADE 
    1515) 
    1616WITH ( 
  • TI01-discovery-Ingest/trunk/v4.3.0/ingestAutomation-upgrade/ingestLoggingDatabase/ProviderEmails.sql

    r7409 r7655  
    1111  id integer NOT NULL, 
    1212  CONSTRAINT provider_emails_pkey PRIMARY KEY (id), 
    13   CONSTRAINT provider_emails_common_id_fkey FOREIGN KEY (common_id) 
     13  CONSTRAINT email_common_idkey FOREIGN KEY (common_id) 
    1414      REFERENCES provider_common (id) MATCH SIMPLE 
    15       ON UPDATE NO ACTION ON DELETE NO ACTION 
     15      ON UPDATE NO ACTION ON DELETE CASCADE 
    1616) 
    1717WITH ( 
  • TI01-discovery-Ingest/trunk/v4.3.0/ingestAutomation-upgrade/ingestLoggingDatabase/create_database.sh

    r7409 r7655  
    2727psql -f IngestLoggingTable.sql $dbOptions 
    2828psql -f IngestProblemFileTable.sql $dbOptions 
     29psql -f ingestSearchLogging.sql $dbOptions 
     30psql -f providerCommonRemoved.sql $dbOptions 
     31psql -f TimerInfo.sql $dbOptions 
     32psql -f TimerInfoLog.sql $dbOptions 
    2933#psql -f GeneratorTable.sql $dbOptions 
    3034#psql -f HiProcess.sql $dbOptions 
  • TI01-discovery-Ingest/trunk/v4.3.0/ingestAutomation-upgrade/ingestLoggingDatabase/provider.sql

    r7409 r7655  
    1616ALTER TABLE provider_common OWNER TO badc; 
    1717 
     18-- DROP FUNCTION remove_provider(); 
     19 
     20CREATE OR REPLACE FUNCTION remove_provider() 
     21  RETURNS trigger AS 
     22$BODY$ 
     23BEGIN 
     24        INSERT INTO provider_common_removed(id, base_url) VALUES (OLD.id, OLD.base_url); 
     25        RETURN OLD; 
     26END; 
     27$BODY$ 
     28  LANGUAGE 'plpgsql' VOLATILE 
     29  COST 100; 
     30ALTER FUNCTION remove_provider() OWNER TO badc; 
     31 
     32-- Trigger: deleteProvider on provider_common 
     33 
     34-- DROP TRIGGER "deleteProvider" ON provider_common; 
     35 
     36CREATE TRIGGER "deleteProvider" 
     37  AFTER DELETE 
     38  ON provider_common 
     39  FOR EACH ROW 
     40  EXECUTE PROCEDURE remove_provider(); 
     41 
    1842INSERT INTO provider_common (id, base_url, email_to_admin, name) VALUES (-1, 'http://neodc.nerc.ac.uk/neodc_oai/provider', true, 'OAIsample'); 
    1943INSERT INTO provider_common (id, base_url, email_to_admin, name) VALUES (-2, 'http://gateway.ceh.ac.uk/soapServices/CSWStartup', true, 'CSWsample'); 
Note: See TracChangeset for help on using the changeset viewer.