From 5b03f458f30857b2b391eb7488a878ce0e5dbdfc Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Tue, 19 Feb 2008 16:07:46 -0800 Subject: [PATCH] Clean up some assumptions with ricky's input. --- fas/fas2.sql | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/fas/fas2.sql b/fas/fas2.sql index fd2bfc9..60ebcb0 100644 --- a/fas/fas2.sql +++ b/fas/fas2.sql @@ -13,7 +13,8 @@ -- General Public License and may only be used or replicated with the express -- permission of Red Hat, Inc. -- --- Red Hat Author(s): Toshio Kuratomi +-- Author(s): Toshio Kuratomi +-- Ricky Zhou -- create database fas2 encoding = 'UTF8'; \c fas2 @@ -22,9 +23,6 @@ create trusted procedural language plpgsql handler plpgsql_call_handler validator plpgsql_validator; -CREATE SEQUENCE cert_seq; -SELECT setval('cert_seq', 1); - CREATE SEQUENCE person_seq; -- TODO: Set this to start where our last person_id is SELECT setval('person_seq', 1111); @@ -48,23 +46,25 @@ CREATE TABLE people ( ssh_key TEXT, -- tg_user::password password VARCHAR(127) NOT NULL, + passwordtoken text null, comments TEXT, postal_address TEXT, telephone TEXT, facsimile TEXT, affiliation TEXT, - certificate_serial INTEGER DEFAULT nextval('cert_seq'), + certificate_serial INTEGER DEFAULT 1, -- tg_user::created creation TIMESTAMP DEFAULT NOW(), - approval_status TEXT DEFAULT 'unapproved', + --approval_status TEXT DEFAULT 'unapproved', internal_comments TEXT, ircnick TEXT, last_seen TIMESTAMP DEFAULT NOW(), status TEXT, status_change TIMESTAMP DEFAULT NOW(), - locale TEXT not null DEFAULT NOW(), - latitude INTEGER, - longitude INTEGER, + locale TEXT not null DEFAULT 'C', + timezone TEXT null DEFAULT 'UTC', + latitude numeric, + longitude numeric, check (status in ('active', 'vacation', 'inactive', 'pinged')), check (gpg_keyid ~ '^[0-9A-F]{17}$') ); @@ -76,6 +76,7 @@ CREATE TABLE person_emails ( person_id integer references people(id) not null, purpose text not null, primary key (person_id, email), + validtoken text null, check (purpose in ('bugzilla', 'primary', 'cla', 'pending')), unique (person_id, purpose) ); @@ -89,7 +90,8 @@ CREATE TABLE configs ( -- Please create more config keys rather than abusing this with -- large datastructures. value TEXT, - check (application in ('asterisk', 'moin', 'myfedora')) + check (application in ('asterisk', 'moin', 'myfedora' ,'openid')) + -- Might end up removing openid, depending on how far we take the provider ); CREATE TABLE groups ( @@ -130,7 +132,7 @@ CREATE TABLE person_roles ( internal_comments text, sponsor_id INTEGER REFERENCES people(id), creation TIMESTAMP DEFAULT NOW(), - approval TIMESTAMP DEFAULT NOW(), + approval TIMESTAMP DEFAULT NULL, primary key (person_id, group_id), check (role_status in ('approved', 'unapproved')), check (role_type in ('user', 'administrator', 'sponsor'))