should now do auto_increment

This commit is contained in:
skeeter 2000-09-15 00:20:58 +00:00
parent 7df2a3e5d8
commit f05827baa7

View File

@ -15,10 +15,18 @@ insert into applications (app_name, app_title, app_enabled) values ('email', 'Em
insert into applications (app_name, app_title, app_enabled) values ('nntp', 'NNTP', 1);
insert into applications (app_name, app_title, app_enabled) values ('cron_apps', 'cron_apps', 0);
create function get_seq(seq_table in varchar2(40))
return number is
seq number(11);
begin
select seq_table.nextval into seq from seq_table;
return(seq);
end
create sequence accounts_seq;
# we need to write an insert trigger for autoincrementation
create table accounts (
con int default 0,
con int default get_seq(accounts_seq),
loginid varchar(25) NOT NULL,
passwd char(32) NOT NULL,
firstname varchar(50),
@ -39,7 +47,7 @@ status) values ('demo','81dc9bdb52d04dc20036dbd8313ed055','Demo','Account',
create sequence groups_seq;
# we need to write an insert trigger for autoincrementation
create table groups (
group_id int default 0,
group_id int default get_seq(groups_seq),
group_name varchar(50),
group_apps varchar(255),
unique(group_id)
@ -90,7 +98,7 @@ create table access_log (
create sequence profiles_seq;
# we need to write an insert trigger for autoincrementation
CREATE TABLE profiles (
con int default 0,
con int default get_seq(profiles_seq),
owner varchar(20),
title varchar(255),
phone_number varchar(255),
@ -103,7 +111,7 @@ CREATE TABLE profiles (
create sequence addressbook_seq;
# we need to write an insert trigger for autoincrementation
create table addressbook (
con int default 0,
con int default get_seq(addressbook_seq),
owner varchar(25),
access varchar(10),
firstname varchar(255),
@ -128,7 +136,7 @@ create table addressbook (
create sequence todo_seq;
# we need to write an insert trigger for autoincrementation
create table todo (
con int default 0,
con int default get_seq(todo_seq),
owner varchar(25),
access varchar(10),
des text,
@ -142,7 +150,7 @@ create table todo (
create sequence webcal_entry_seq;
# we need to write an insert trigger for autoincrementation
CREATE TABLE webcal_entry (
cal_id int default 0,
cal_id int default get_seq(webcal_entry_seq),
cal_group_id int NULL,
cal_create_by varchar(25) NOT NULL,
cal_date int NOT NULL,
@ -180,7 +188,7 @@ create table webcal_entry_groups (
create sequence newsgroups_seq;
# we need to write an insert trigger for autoincrementation
CREATE TABLE newsgroups (
con int default 0,
con int default get_seq(newsgroups_seq),
name varchar(255) NOT NULL,
messagecount int NOT NULL,
lastmessage int NOT NULL,