Thread: [Lxr-commits] CVS: lxr INSTALL,1.16,1.17 initdb-mysql,1.9,1.10 initdb-oracle.sql,1.2,1.3 initdb-post
Brought to you by:
ajlittoz
From: Dave B. <bro...@us...> - 2004-07-20 15:31:37
|
Update of /cvsroot/lxr/lxr In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22189 Modified Files: INSTALL initdb-mysql initdb-oracle.sql initdb-postgres Removed Files: initdb Log Message: prefix tables with lxr_ (configurable). existing users should set dbprefix to '' since their tables have no prefix fix ordering of delete statements fix some oracle syntax Index: INSTALL =================================================================== RCS file: /cvsroot/lxr/lxr/INSTALL,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- INSTALL 19 Jul 2004 20:03:31 -0000 1.16 +++ INSTALL 20 Jul 2004 15:31:24 -0000 1.17 @@ -31,7 +31,10 @@ You will need to create a database for lxr, and possibly create a user as well. If you are unsure how to do this, or don't have admin rights to the database, consult the documentation or your sysadmin -respectively. The steps below assume you know what you're doing. +respectively. If you want a custom prefix for the table names, you must +manually edit the initdb script by replaceing every 'lxr_' with your prefix. +Don't forget to set the 'dbprefix' in lxr.conf. +The steps below assume you know what you're doing. For Postgresql: Create a user for lxr and give the user permission to create databases: Index: initdb-mysql =================================================================== RCS file: /cvsroot/lxr/lxr/initdb-mysql,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- initdb-mysql 2 May 2003 22:58:34 -0000 1.9 +++ initdb-mysql 20 Jul 2004 15:31:24 -0000 1.10 @@ -6,7 +6,7 @@ use lxr; /* symnum filenum */ -create table files ( +create table lxr_files ( filename char(255) binary not null, revision char(255) binary not null, fileid int not null auto_increment, @@ -15,7 +15,7 @@ ); -create table symbols ( +create table lxr_symbols ( symname char(255) binary not null, symid int not null auto_increment, primary key (symid), @@ -23,34 +23,34 @@ ); -create table indexes ( - symid int not null references symbols, - fileid int not null references files, +create table lxr_indexes ( + symid int not null references lxr_symbols, + fileid int not null references lxr_files, line int not null, - langid tinyint not null references declarations, - type smallint not null references declarations, - relsym int references symbols + langid tinyint not null references lxr_declarations, + type smallint not null references lxr_declarations, + relsym int references lxr_symbols ); -create table releases - (fileid int not null references files, +create table lxr_releases + (fileid int not null references lxr_files, release char(255) binary not null, primary key (fileid,release) ); -create table useage - (fileid int not null references files, +create table lxr_useage + (fileid int not null references lxr_files, line int not null, - symid int not null references symbols + symid int not null references lxr_symbols ); -create table status - (fileid int not null references files, +create table lxr_status + (fileid int not null references lxr_files, status tinyint not null, primary key (fileid) ); -create table declarations +create table lxr_declarations (declid smallint not null auto_increment, langid tinyint not null, declaration char(255) not null, @@ -58,9 +58,9 @@ ); -create index indexindex on indexes (symid) ; -create unique index symbolindex on symbols (symname) ; -create index useageindex on useage (symid) ; -create index filelookup on files (filename); +create index lxr_indexindex on lxr_indexes (symid) ; +create unique index lxr_symbolindex on lxr_symbols (symname) ; +create index lxr_useageindex on lxr_useage (symid) ; +create index lxr_filelookup on lxr_files (filename); grant all on lxr.* to lxr@localhost; Index: initdb-oracle.sql =================================================================== RCS file: /cvsroot/lxr/lxr/initdb-oracle.sql,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- initdb-oracle.sql 15 Jul 2004 20:40:13 -0000 1.2 +++ initdb-oracle.sql 20 Jul 2004 15:31:24 -0000 1.3 @@ -1,78 +1,78 @@ -drop sequence filenum; -drop sequence symnum; -drop table indexes; -drop table usage; -drop table symbols; -drop table releases; -drop table status; -drop table files; +drop sequence lxr_filenum; +drop sequence lxr_symnum; +drop table lxr_indexes; +drop table lxr_usage; +drop table lxr_symbols; +drop table lxr_releases; +drop table lxr_status; +drop table lxr_files; commit; -create sequence filenum; -create sequence symnum; +create sequence lxr_filenum; +create sequence lxr_symnum; commit; -create table files ( +create table lxr_files ( filename varchar2(250), revision varchar2(250), fileid number, - constraint pk_files primary key (fileid) + constraint lxr_pk_files primary key (fileid) ); -alter table files add unique (filename, revision); -create index i_files on files(filename); +alter table lxr_files add unique (filename, revision); +create index lxr_i_files on lxr_files(filename); commit; -create table symbols ( +create table lxr_symbols ( symname varchar2(250), symid number, - constraint pk_symbols primary key (symid) + constraint lxr_pk_symbols primary key (symid) ); -alter table symbols add unique(symname); +alter table lxr_symbols add unique(symname); commit; -create table indexes ( +create table lxr_indexes ( symid number, fileid number, line number, type varchar2(250), relsym number, - constraint fk_indexes_fileid foreign key (fileid) references files(fileid), - constraint fk_indexes_symid foreign key (symid) references symbols(symid), - constraint fk_indexes_relsym foreign key (relsym) references symbols(symid) + constraint lxr_fk_indexes_fileid foreign key (fileid) references lxr_files(fileid), + constraint lxr_fk_indexes_symid foreign key (symid) references lxr_symbols(symid), + constraint lxr_fk_indexes_relsym foreign key (relsym) references lxr_symbols(symid) ); -create index i_indexes on indexes(symid); +create index lxr_i_indexes on lxr_indexes(symid); commit; -create table releases ( +create table lxr_releases ( fileid number, release varchar2(250), - constraint pk_releases primary key (fileid,release), - constraint fk_releases_fileid foreign key (fileid) references files(fileid) + constraint lxr_pk_releases primary key (fileid,release), + constraint lxr_fk_releases_fileid foreign key (fileid) references lxr_files(fileid) ); commit; -create table status ( +create table lxr_status ( fileid number, status number, - constraint pk_status primary key (fileid), - constraint fk_status_fileid foreign key (fileid) references files(fileid) + constraint lxr_pk_status primary key (fileid), + constraint lxr_fk_status_fileid foreign key (fileid) references lxr_files(fileid) ); commit; -create table usage ( +create table lxr_usage ( fileid number, line number, symid number, - constraint fk_usage_fileid foreign key (fileid) references files(fileid), - constraint fk_usage_symid foreign key (symid) references symbols(symid) + constraint lxr_fk_usage_fileid foreign key (fileid) references lxr_files(fileid), + constraint lxr_fk_usage_symid foreign key (symid) references lxr_symbols(symid) ); -create index i_usage on usage(symid); +create index lxr_i_usage on lxr_usage(symid); commit; \ No newline at end of file Index: initdb-postgres =================================================================== RCS file: /cvsroot/lxr/lxr/initdb-postgres,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- initdb-postgres 28 Nov 2001 12:59:02 -0000 1.5 +++ initdb-postgres 20 Jul 2004 15:31:24 -0000 1.6 @@ -1,19 +1,19 @@ -drop sequence filenum; -drop sequence symnum; -drop sequence declnum; -drop table files; -drop table symbols; -drop table indexes; -drop table releases; -drop table usage; -drop table status; -drop table declarations; +drop sequence lxr_filenum; +drop sequence lxr_symnum; +drop sequence lxr_declnum; +drop table lxr_files; +drop table lxr_symbols; +drop table lxr_indexes; +drop table lxr_releases; +drop table lxr_usage; +drop table lxr_status; +drop table lxr_declarations; -create sequence filenum cache 50; -create sequence symnum cache 50; -create sequence declnum cache 10; +create sequence lxr_filenum cache 50; +create sequence lxr_symnum cache 50; +create sequence lxr_declnum cache 10; -create table files ( +create table lxr_files ( filename varchar, revision varchar, fileid int, @@ -22,7 +22,7 @@ ); -create table symbols ( +create table lxr_symbols ( symname varchar, symid int, primary key (symid), @@ -30,50 +30,50 @@ ); -create table declarations ( +create table lxr_declarations ( declid smallint not null, langid smallint not null, declaration char(255) not null, primary key (declid, langid) ); -create table indexes ( - symid int references symbols, - fileid int references files, +create table lxr_indexes ( + symid int references lxr_symbols, + fileid int references lxr_files, line int, langid smallint not null, type smallint not null, - relsym int references symbols, - foreign key (langid, type) references declarations (langid, declid) + relsym int references lxr_symbols, + foreign key (langid, type) references lxr_declarations (langid, declid) ); -create table releases - (fileid int references files, +create table lxr_releases + (fileid int references lxr_files, release varchar, primary key (fileid,release) ); -create table usage - (fileid int references files, +create table lxr_usage + (fileid int references lxr_files, line int, - symid int references symbols + symid int references lxr_symbols ); -create table status - (fileid int references files, +create table lxr_status + (fileid int references lxr_files, status smallint, primary key (fileid) ); -create index indexindex on indexes using btree (symid); -create index symbolindex on symbols using btree (symname); -create index usageindex on usage using btree (symid); -create index filelookup on files using btree (filename); +create index lxr_indexindex on lxr_indexes using btree (symid); +create index lxr_symbolindex on lxr_symbols using btree (symname); +create index lxr_usageindex on lxr_usage using btree (symid); +create index lxr_filelookup on lxr_files using btree (filename); -grant select on files to public; -grant select on symbols to public; -grant select on indexes to public; -grant select on releases to public; -grant select on usage to public; -grant select on status to public; -grant select on declarations to public; \ No newline at end of file +grant select on lxr_files to public; +grant select on lxr_symbols to public; +grant select on lxr_indexes to public; +grant select on lxr_releases to public; +grant select on lxr_usage to public; +grant select on lxr_status to public; +grant select on lxr_declarations to public; \ No newline at end of file --- initdb DELETED --- |