Merge with mmcgrath's changes.

This commit is contained in:
Toshio Kuratomi 2008-02-15 15:10:31 -08:00
parent 627157d4ba
commit fe2589cfe4

View file

@ -10,11 +10,11 @@ SELECT setval('cert_seq', 1);
CREATE SEQUENCE person_seq; CREATE SEQUENCE person_seq;
-- TODO: Set this to start where our last person_id is -- TODO: Set this to start where our last person_id is
SELECT setval('person_seq', 100000); SELECT setval('person_seq', 1111);
CREATE SEQUENCE group_seq; CREATE SEQUENCE group_seq;
-- TODO: Set this to start where our last group_id is -- TODO: Set this to start where our last group_id is
SELECT setval('group_seq', 100000); SELECT setval('group_seq', 1222);
CREATE TABLE people ( CREATE TABLE people (
id INTEGER PRIMARY KEY NOT NULL DEFAULT nextval('person_seq'), id INTEGER PRIMARY KEY NOT NULL DEFAULT nextval('person_seq'),
@ -32,7 +32,7 @@ CREATE TABLE people (
telephone TEXT, telephone TEXT,
facsimile TEXT, facsimile TEXT,
affiliation TEXT, affiliation TEXT,
certificate_serial integer default nextval('cert_seq'), certificate_serial INTEGER DEFAULT nextval('cert_seq'),
creation TIMESTAMP DEFAULT NOW(), creation TIMESTAMP DEFAULT NOW(),
approval_status TEXT DEFAULT 'unapproved', approval_status TEXT DEFAULT 'unapproved',
internal_comments TEXT, internal_comments TEXT,
@ -47,8 +47,8 @@ CREATE TABLE people (
CREATE TABLE configs ( CREATE TABLE configs (
id SERIAL PRIMARY KEY, id SERIAL PRIMARY KEY,
person_id integer references people(id), person_id integer references people(id),
application text not null, application TEXT not null,
attribute text not null, attribute TEXT not null,
-- The value should be a simple value or a json string. -- The value should be a simple value or a json string.
-- Please create more config keys rather than abusing this with -- Please create more config keys rather than abusing this with
-- large datastructures. -- large datastructures.
@ -70,7 +70,7 @@ CREATE TABLE groups (
); );
create table person_emails ( create table person_emails (
email text not null unique, email text UNIQUE NOT NULL,
person_id integer references people(id) not null, person_id integer references people(id) not null,
purpose text not null, purpose text not null,
primary key (person_id, email), primary key (person_id, email),
@ -81,7 +81,7 @@ create table person_emails (
create table group_emails ( create table group_emails (
email text not null unique, email text not null unique,
group_id integer references groups(id) not null, group_id INTEGER references groups(id) not null,
purpose text not null, purpose text not null,
primary key (group_id, email), primary key (group_id, email),
check (purpose in ('bugzilla', 'primary', 'cla')), check (purpose in ('bugzilla', 'primary', 'cla')),
@ -122,9 +122,9 @@ CREATE TABLE person_roles (
-- action a == add -- action a == add
create table bugzilla_queue ( create table bugzilla_queue (
email text not null, email text not null,
group_id int references groups(id) not null, group_id INTEGER references groups(id) not null,
person_id int references people(id) not null, person_id INTEGER references people(id) not null,
action char(1) not null, action CHAR(1) not null,
primary key (email, group_id), primary key (email, group_id),
check (action ~ '[ar]') check (action ~ '[ar]')
); );