[Bio] / BioSimScratch / CreateCatalog-pg.sql Repository:
ViewVC logotype

View of /BioSimScratch/CreateCatalog-pg.sql

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (download) (annotate)
Tue Oct 19 19:33:32 2004 UTC (15 years ago) by efrank
Branch: MAIN
CVS Tags: post-st-migration2, sc2004-3, post-st-migration, sc2004-4, sc04-finalDay, sc2004-2, sc2004-1, sc2004-0, HEAD
make work for pg too

-- ---------------------------------------------------------------
drop   table KahCatDirEntry;
create table KahCatDirEntry (
--
-- Lists all KahCatDirEntry 
-- ---------------------------------------------------------------
--
	CatName   	varchar(128)	NOT NULL,
--	/* A short name for the metabolite */
--
	CatDirEntId	integer 	NOT NULL,
        isTerminal      integer         DEFAULT 0  NOT NULL,
        NextVer         integer         DEFAULT 0  NOT NULL,
        FullPathName    varchar(1024)  NOT NULL,
	/* The full name (in someones universe) */
--
	CONSTRAINT KahCatDirEntry_PK PRIMARY KEY (CatDirEntID)
);

drop   sequence KahCatDirEntIdSequence;
create sequence KahCatDirEntIdSequence  increment by 1 start with 50000;


drop   table KahCatSubDir;
create table KahCatSubDir(
--
-- Defines the CatEntry with CatEntryID and name
--
-- ----------------------------------------------------------------------
--
	ParentCatDirEntId	integer 	NOT NULL,
--
	ChildCatDirEntId	integer		NOT NULL,
--
        CONSTRAINT KahCatSubDir_Uniq  UNIQUE (ParentCatDirEntId, ChildCatDirEntId)
--
);


drop   table KahCatDirEntVersions;
create table KahCatDirEntVersions  (
-- ---------------------------------------------------------------
--
-- Lists all versions associated with a catalog entry
--
	CatDirEntId     	integer  NOT NULL,
	VerNo 	  		integer 	NOT NULL,
        DefaultVer      	integer,
	CONSTRAINT KahCatDirEntVersions_PK PRIMARY KEY (CatDirEntId,VerNo )
);

-- ----------------------------------------------------------------------
drop   table KahNavCat2ObjMod;
create table KahNavCat2ObjMod (
--
-- A relation that navigates from the Catalog Entry to the Object 
-- Model.
-- ----------------------------------------------------------------------
--
	CatDirEntId                integer     NOT NULL,
        VerNo                      integer     NOT NULL,
--
        FoundryId                 varchar(128)	  NOT NULL,
        KeyIntVal                 integer      NOT NULL,
        KeyStrVal                 varchar(128),
        CONSTRAINT KahNavCat2ObjMod_PK PRIMARY KEY (CatDirEntId, VerNo),
        CONSTRAINT KahNavCat2FoundryItem_Uniq  UNIQUE(  FoundryId,KeyIntVal, KeyStrVal) 
);


drop   table KahNavCat2Prov;
create table KahNavCat2Prov (
--
-- A relation that navigates from the Catalog Entry to the Provenance 
-- Model.
-- ----------------------------------------------------------------------
--
	CatDirEntId               integer     NOT NULL,
        VerNo                     integer     NOT NULL,
--
        ProvInfoId                  integer	NOT NULL,
        CONSTRAINT KahNavCat2Prov_PK PRIMARY KEY (CatDirEntId, VerNo)     
);



drop   table KahFoundryRegistry;
create table KahFoundryRegistry (
--
-- IGNORE THIS ONE.  ITS BEEN ABANDONED FOR NOW
--
-- A relation that contains information about the FoundryId and Name. 
-- ----------------------------------------------------------------------
--
	FoundryId                    integer        NOT NULL,
	FoundryName                  varchar(128)     NOT NULL,            
        CONSTRAINT KahFoundryRegistry_PK PRIMARY KEY (FoundryId),
        CONSTRAINT KahFoundryName_Uniq  UNIQUE (FoundryName )     
);





-- INSERT INTO KahCatDirEntry values ('BioSimScratch', 0, 0, 0, '/Bss');

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3