Clean up some assumptions with ricky's input.
This commit is contained in:
parent
5ac6e4b83e
commit
5b03f458f3
1 changed files with 13 additions and 11 deletions
24
fas/fas2.sql
24
fas/fas2.sql
|
@ -13,7 +13,8 @@
|
||||||
-- General Public License and may only be used or replicated with the express
|
-- General Public License and may only be used or replicated with the express
|
||||||
-- permission of Red Hat, Inc.
|
-- permission of Red Hat, Inc.
|
||||||
--
|
--
|
||||||
-- Red Hat Author(s): Toshio Kuratomi <tkuratom@redhat.com>
|
-- Author(s): Toshio Kuratomi <tkuratom@redhat.com>
|
||||||
|
-- Ricky Zhou <ricky@fedoraproject.org>
|
||||||
--
|
--
|
||||||
create database fas2 encoding = 'UTF8';
|
create database fas2 encoding = 'UTF8';
|
||||||
\c fas2
|
\c fas2
|
||||||
|
@ -22,9 +23,6 @@ create trusted procedural language plpgsql
|
||||||
handler plpgsql_call_handler
|
handler plpgsql_call_handler
|
||||||
validator plpgsql_validator;
|
validator plpgsql_validator;
|
||||||
|
|
||||||
CREATE SEQUENCE cert_seq;
|
|
||||||
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', 1111);
|
SELECT setval('person_seq', 1111);
|
||||||
|
@ -48,23 +46,25 @@ CREATE TABLE people (
|
||||||
ssh_key TEXT,
|
ssh_key TEXT,
|
||||||
-- tg_user::password
|
-- tg_user::password
|
||||||
password VARCHAR(127) NOT NULL,
|
password VARCHAR(127) NOT NULL,
|
||||||
|
passwordtoken text null,
|
||||||
comments TEXT,
|
comments TEXT,
|
||||||
postal_address TEXT,
|
postal_address TEXT,
|
||||||
telephone TEXT,
|
telephone TEXT,
|
||||||
facsimile TEXT,
|
facsimile TEXT,
|
||||||
affiliation TEXT,
|
affiliation TEXT,
|
||||||
certificate_serial INTEGER DEFAULT nextval('cert_seq'),
|
certificate_serial INTEGER DEFAULT 1,
|
||||||
-- tg_user::created
|
-- tg_user::created
|
||||||
creation TIMESTAMP DEFAULT NOW(),
|
creation TIMESTAMP DEFAULT NOW(),
|
||||||
approval_status TEXT DEFAULT 'unapproved',
|
--approval_status TEXT DEFAULT 'unapproved',
|
||||||
internal_comments TEXT,
|
internal_comments TEXT,
|
||||||
ircnick TEXT,
|
ircnick TEXT,
|
||||||
last_seen TIMESTAMP DEFAULT NOW(),
|
last_seen TIMESTAMP DEFAULT NOW(),
|
||||||
status TEXT,
|
status TEXT,
|
||||||
status_change TIMESTAMP DEFAULT NOW(),
|
status_change TIMESTAMP DEFAULT NOW(),
|
||||||
locale TEXT not null DEFAULT NOW(),
|
locale TEXT not null DEFAULT 'C',
|
||||||
latitude INTEGER,
|
timezone TEXT null DEFAULT 'UTC',
|
||||||
longitude INTEGER,
|
latitude numeric,
|
||||||
|
longitude numeric,
|
||||||
check (status in ('active', 'vacation', 'inactive', 'pinged')),
|
check (status in ('active', 'vacation', 'inactive', 'pinged')),
|
||||||
check (gpg_keyid ~ '^[0-9A-F]{17}$')
|
check (gpg_keyid ~ '^[0-9A-F]{17}$')
|
||||||
);
|
);
|
||||||
|
@ -76,6 +76,7 @@ CREATE TABLE person_emails (
|
||||||
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),
|
||||||
|
validtoken text null,
|
||||||
check (purpose in ('bugzilla', 'primary', 'cla', 'pending')),
|
check (purpose in ('bugzilla', 'primary', 'cla', 'pending')),
|
||||||
unique (person_id, purpose)
|
unique (person_id, purpose)
|
||||||
);
|
);
|
||||||
|
@ -89,7 +90,8 @@ CREATE TABLE configs (
|
||||||
-- Please create more config keys rather than abusing this with
|
-- Please create more config keys rather than abusing this with
|
||||||
-- large datastructures.
|
-- large datastructures.
|
||||||
value TEXT,
|
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 (
|
CREATE TABLE groups (
|
||||||
|
@ -130,7 +132,7 @@ CREATE TABLE person_roles (
|
||||||
internal_comments text,
|
internal_comments text,
|
||||||
sponsor_id INTEGER REFERENCES people(id),
|
sponsor_id INTEGER REFERENCES people(id),
|
||||||
creation TIMESTAMP DEFAULT NOW(),
|
creation TIMESTAMP DEFAULT NOW(),
|
||||||
approval TIMESTAMP DEFAULT NOW(),
|
approval TIMESTAMP DEFAULT NULL,
|
||||||
primary key (person_id, group_id),
|
primary key (person_id, group_id),
|
||||||
check (role_status in ('approved', 'unapproved')),
|
check (role_status in ('approved', 'unapproved')),
|
||||||
check (role_type in ('user', 'administrator', 'sponsor'))
|
check (role_type in ('user', 'administrator', 'sponsor'))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue