1998-06-17 01:43:24 +04:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
1999-11-02 02:33:56 +03:00
|
|
|
# The contents of this file are subject to the Netscape Public
|
|
|
|
# License Version 1.1 (the "License"); you may not use this file
|
|
|
|
# except in compliance with the License. You may obtain a copy of
|
|
|
|
# the License at http://www.mozilla.org/NPL/
|
1998-06-17 01:43:24 +04:00
|
|
|
#
|
1999-11-02 02:33:56 +03:00
|
|
|
# Software distributed under the License is distributed on an "AS
|
|
|
|
# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
|
|
|
|
# implied. See the License for the specific language governing
|
|
|
|
# rights and limitations under the License.
|
1998-06-17 01:43:24 +04:00
|
|
|
#
|
|
|
|
# The Original Code is the Bonsai CVS tool.
|
|
|
|
#
|
|
|
|
# The Initial Developer of the Original Code is Netscape Communications
|
1999-11-02 02:33:56 +03:00
|
|
|
# Corporation. Portions created by Netscape are
|
|
|
|
# Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
# Rights Reserved.
|
|
|
|
#
|
|
|
|
# Contributor(s):
|
1998-06-17 01:43:24 +04:00
|
|
|
|
1999-04-30 22:38:50 +04:00
|
|
|
USER=nobody
|
|
|
|
PASSWORD=
|
|
|
|
|
|
|
|
if test x$PASSWORD = x ; then
|
|
|
|
MYSQL="mysql -u $USER"
|
|
|
|
else
|
|
|
|
MYSQL="mysql -u $USER -p $PASSWORD"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo
|
|
|
|
echo "Will use user=\"$USER\" and password=\"$PASSWORD\" for bonsai database."
|
|
|
|
echo "If you have a previous bonsai install, this script will drop all"
|
|
|
|
echo "bonsai tables. Press ctrl-c to bail out now or return to continue."
|
|
|
|
|
1999-05-13 01:41:57 +04:00
|
|
|
read dummy
|
1999-04-30 22:38:50 +04:00
|
|
|
|
|
|
|
echo Dropping old tables
|
|
|
|
|
1999-09-17 19:47:03 +04:00
|
|
|
$MYSQL << OK_ALL_DONE
|
1998-06-17 01:43:24 +04:00
|
|
|
|
|
|
|
use bonsai;
|
|
|
|
|
|
|
|
drop table descs;
|
|
|
|
drop table checkins;
|
|
|
|
drop table people;
|
|
|
|
drop table repositories;
|
|
|
|
drop table dirs;
|
|
|
|
drop table files;
|
|
|
|
drop table branches;
|
|
|
|
drop table tags;
|
|
|
|
OK_ALL_DONE
|
|
|
|
|
1999-04-30 22:38:50 +04:00
|
|
|
echo creating new tables
|
1998-06-17 01:43:24 +04:00
|
|
|
|
1999-04-30 22:38:50 +04:00
|
|
|
$MYSQL << OK_ALL_DONE
|
1998-06-17 01:43:24 +04:00
|
|
|
use bonsai;
|
|
|
|
create table descs (
|
|
|
|
id mediumint not null auto_increment primary key,
|
1999-07-23 22:39:31 +04:00
|
|
|
description text,
|
|
|
|
hash bigint not null,
|
|
|
|
|
|
|
|
index(hash)
|
1998-06-17 01:43:24 +04:00
|
|
|
);
|
|
|
|
|
|
|
|
show columns from descs;
|
|
|
|
show index from descs;
|
|
|
|
|
|
|
|
create table people (
|
|
|
|
id mediumint not null auto_increment primary key,
|
1999-11-09 21:12:43 +03:00
|
|
|
who varchar(32) binary not null,
|
1998-06-17 01:43:24 +04:00
|
|
|
|
|
|
|
unique(who)
|
|
|
|
);
|
|
|
|
|
|
|
|
show columns from people;
|
|
|
|
show index from people;
|
|
|
|
|
|
|
|
|
|
|
|
create table repositories (
|
|
|
|
id mediumint not null auto_increment primary key,
|
1999-11-09 21:12:43 +03:00
|
|
|
repository varchar(64) binary not null,
|
1998-06-17 01:43:24 +04:00
|
|
|
|
|
|
|
unique(repository)
|
|
|
|
);
|
|
|
|
|
|
|
|
show columns from repositories;
|
|
|
|
show index from repositories;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
create table dirs (
|
|
|
|
id mediumint not null auto_increment primary key,
|
1999-11-09 21:12:43 +03:00
|
|
|
dir varchar(128) binary not null,
|
1998-06-17 01:43:24 +04:00
|
|
|
|
|
|
|
unique(dir)
|
|
|
|
);
|
|
|
|
|
|
|
|
show columns from dirs;
|
|
|
|
show index from dirs;
|
|
|
|
|
|
|
|
|
|
|
|
create table files (
|
|
|
|
id mediumint not null auto_increment primary key,
|
1999-11-09 21:12:43 +03:00
|
|
|
file varchar(128) binary not null,
|
1998-06-17 01:43:24 +04:00
|
|
|
|
|
|
|
unique(file)
|
|
|
|
);
|
|
|
|
|
|
|
|
show columns from files;
|
|
|
|
show index from files;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
create table branches (
|
|
|
|
id mediumint not null auto_increment primary key,
|
1999-11-09 21:12:43 +03:00
|
|
|
branch varchar(64) binary not null,
|
1998-06-17 01:43:24 +04:00
|
|
|
|
|
|
|
unique(branch)
|
|
|
|
);
|
|
|
|
|
|
|
|
show columns from branches;
|
|
|
|
show index from branches;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
create table checkins (
|
|
|
|
type enum('Change', 'Add', 'Remove'),
|
1999-10-12 22:05:42 +04:00
|
|
|
ci_when datetime not null,
|
1998-06-17 01:43:24 +04:00
|
|
|
whoid mediumint not null,
|
|
|
|
repositoryid mediumint not null,
|
|
|
|
dirid mediumint not null,
|
|
|
|
fileid mediumint not null,
|
1999-11-09 21:12:43 +03:00
|
|
|
revision varchar(32) binary not null,
|
|
|
|
stickytag varchar(255) binary not null,
|
1998-06-17 01:43:24 +04:00
|
|
|
branchid mediumint not null,
|
|
|
|
addedlines int not null,
|
|
|
|
removedlines int not null,
|
|
|
|
descid mediumint,
|
|
|
|
|
|
|
|
unique (repositoryid,dirid,fileid,revision),
|
1999-10-12 22:05:42 +04:00
|
|
|
index(ci_when),
|
1998-06-17 01:43:24 +04:00
|
|
|
index(whoid),
|
|
|
|
index(repositoryid),
|
|
|
|
index(dirid),
|
|
|
|
index(fileid),
|
|
|
|
index(branchid)
|
|
|
|
);
|
|
|
|
|
|
|
|
show columns from checkins;
|
|
|
|
show index from checkins;
|
|
|
|
|
|
|
|
|
|
|
|
create table tags (
|
|
|
|
repositoryid mediumint not null,
|
|
|
|
branchid mediumint not null,
|
|
|
|
dirid mediumint not null,
|
|
|
|
fileid mediumint not null,
|
1999-11-09 21:12:43 +03:00
|
|
|
revision varchar(32) binary not null,
|
1998-06-17 01:43:24 +04:00
|
|
|
|
|
|
|
unique(repositoryid,dirid,fileid,branchid,revision),
|
|
|
|
index(repositoryid),
|
|
|
|
index(dirid),
|
|
|
|
index(fileid),
|
|
|
|
index(branchid)
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
OK_ALL_DONE
|