mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-03 04:29:28 +01:00
should now do auto_increment
This commit is contained in:
parent
7df2a3e5d8
commit
f05827baa7
@ -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 ('nntp', 'NNTP', 1);
|
||||||
insert into applications (app_name, app_title, app_enabled) values ('cron_apps', 'cron_apps', 0);
|
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;
|
create sequence accounts_seq;
|
||||||
# we need to write an insert trigger for autoincrementation
|
# we need to write an insert trigger for autoincrementation
|
||||||
create table accounts (
|
create table accounts (
|
||||||
con int default 0,
|
con int default get_seq(accounts_seq),
|
||||||
loginid varchar(25) NOT NULL,
|
loginid varchar(25) NOT NULL,
|
||||||
passwd char(32) NOT NULL,
|
passwd char(32) NOT NULL,
|
||||||
firstname varchar(50),
|
firstname varchar(50),
|
||||||
@ -39,7 +47,7 @@ status) values ('demo','81dc9bdb52d04dc20036dbd8313ed055','Demo','Account',
|
|||||||
create sequence groups_seq;
|
create sequence groups_seq;
|
||||||
# we need to write an insert trigger for autoincrementation
|
# we need to write an insert trigger for autoincrementation
|
||||||
create table groups (
|
create table groups (
|
||||||
group_id int default 0,
|
group_id int default get_seq(groups_seq),
|
||||||
group_name varchar(50),
|
group_name varchar(50),
|
||||||
group_apps varchar(255),
|
group_apps varchar(255),
|
||||||
unique(group_id)
|
unique(group_id)
|
||||||
@ -90,7 +98,7 @@ create table access_log (
|
|||||||
create sequence profiles_seq;
|
create sequence profiles_seq;
|
||||||
# we need to write an insert trigger for autoincrementation
|
# we need to write an insert trigger for autoincrementation
|
||||||
CREATE TABLE profiles (
|
CREATE TABLE profiles (
|
||||||
con int default 0,
|
con int default get_seq(profiles_seq),
|
||||||
owner varchar(20),
|
owner varchar(20),
|
||||||
title varchar(255),
|
title varchar(255),
|
||||||
phone_number varchar(255),
|
phone_number varchar(255),
|
||||||
@ -103,7 +111,7 @@ CREATE TABLE profiles (
|
|||||||
create sequence addressbook_seq;
|
create sequence addressbook_seq;
|
||||||
# we need to write an insert trigger for autoincrementation
|
# we need to write an insert trigger for autoincrementation
|
||||||
create table addressbook (
|
create table addressbook (
|
||||||
con int default 0,
|
con int default get_seq(addressbook_seq),
|
||||||
owner varchar(25),
|
owner varchar(25),
|
||||||
access varchar(10),
|
access varchar(10),
|
||||||
firstname varchar(255),
|
firstname varchar(255),
|
||||||
@ -128,7 +136,7 @@ create table addressbook (
|
|||||||
create sequence todo_seq;
|
create sequence todo_seq;
|
||||||
# we need to write an insert trigger for autoincrementation
|
# we need to write an insert trigger for autoincrementation
|
||||||
create table todo (
|
create table todo (
|
||||||
con int default 0,
|
con int default get_seq(todo_seq),
|
||||||
owner varchar(25),
|
owner varchar(25),
|
||||||
access varchar(10),
|
access varchar(10),
|
||||||
des text,
|
des text,
|
||||||
@ -142,7 +150,7 @@ create table todo (
|
|||||||
create sequence webcal_entry_seq;
|
create sequence webcal_entry_seq;
|
||||||
# we need to write an insert trigger for autoincrementation
|
# we need to write an insert trigger for autoincrementation
|
||||||
CREATE TABLE webcal_entry (
|
CREATE TABLE webcal_entry (
|
||||||
cal_id int default 0,
|
cal_id int default get_seq(webcal_entry_seq),
|
||||||
cal_group_id int NULL,
|
cal_group_id int NULL,
|
||||||
cal_create_by varchar(25) NOT NULL,
|
cal_create_by varchar(25) NOT NULL,
|
||||||
cal_date int NOT NULL,
|
cal_date int NOT NULL,
|
||||||
@ -180,7 +188,7 @@ create table webcal_entry_groups (
|
|||||||
create sequence newsgroups_seq;
|
create sequence newsgroups_seq;
|
||||||
# we need to write an insert trigger for autoincrementation
|
# we need to write an insert trigger for autoincrementation
|
||||||
CREATE TABLE newsgroups (
|
CREATE TABLE newsgroups (
|
||||||
con int default 0,
|
con int default get_seq(newsgroups_seq),
|
||||||
name varchar(255) NOT NULL,
|
name varchar(255) NOT NULL,
|
||||||
messagecount int NOT NULL,
|
messagecount int NOT NULL,
|
||||||
lastmessage int NOT NULL,
|
lastmessage int NOT NULL,
|
||||||
|
Loading…
Reference in New Issue
Block a user