User Tools

Site Tools


podoc:users_sql_table

Database Table Description of "users"

Name

users

Description

Purpose

Schema

CREATE TABLE users (
  identifier                     INTEGER NOT NULL PRIMARY KEY,
  first_name                     VARCHAR(50),
  last_name                      VARCHAR(50),
  company                        VARCHAR(50),
  username                       VARCHAR(30),
  password                       VARCHAR(30),
  contact                        INTEGER REFERENCES contact_info(identifier),
  member_since                   TIMESTAMP,
  TYPE                           INTEGER NOT NULL REFERENCES user_type(identifier)
);

References other tables

Is referenced by other tables

History

Used first

Version 2.5

Used last

Still in use

Schema change history

= Version 2.5 =

CREATE TABLE users (
  identifier            INTEGER NOT NULL PRIMARY KEY,
  first_name            VARCHAR(50),
  last_name             VARCHAR(50),
  company               VARCHAR(50),
  username              VARCHAR(30),
  password              VARCHAR(30),
  session_id            VARCHAR(32),
  contact               INTEGER REFERENCES contact_info(identifier),
  member_since          TIMESTAMP,
  preferences           INTEGER REFERENCES preferences(identifier),
  TYPE                  INTEGER NOT NULL REFERENCES user_type(identifier),
  hide                  BOOLEAN NOT NULL DEFAULT 'f'
);

= Version 2.11 =

-- create new reference from the users table
ALTER TABLE users ADD COLUMN imagemagick_options INTEGER REFERENCES imagemagick_options(identifier);

= Version 2.18 =

ALTER TABLE users ADD COLUMN shared CHAR(1) CHECK (shared IN ('t', 'f'));

= Version 2.21 =

ALTER TABLE users ADD COLUMN imagemagick_composite_options INTEGER REFERENCES imagemagick_composite_options(identifier);
 
UPDATE users SET imagemagick_composite_options = imagemagick_options;
ALTER TABLE users ALTER COLUMN imagemagick_composite_options SET NOT NULL;
 
ALTER TABLE users ADD COLUMN dcraw_options INTEGER REFERENCES dcraw_options(identifier);
 
UPDATE users SET dcraw_options = imagemagick_options;
ALTER TABLE users ALTER COLUMN dcraw_options SET NOT NULL;

= Version 2.34 =

-- Drop more obsolete user stuff
 
ALTER TABLE users DROP shared;
ALTER TABLE users DROP session_id;
ALTER TABLE users DROP preferences;
ALTER TABLE users DROP imagemagick_options;
ALTER TABLE users DROP imagemagick_composite_options;
ALTER TABLE users DROP dcraw_options;
--- Add a 'hide' field to the users table.
 
ALTER TABLE users ADD hide BOOLEAN;
ALTER TABLE users ALTER COLUMN hide SET DEFAULT 'f';
ALTER TABLE users ALTER COLUMN hide SET NOT NULL;
Data change history

= Version 2.5 =

INSERT INTO users VALUES (1, 'admin', 'admin', '', 'admin', 'admin', '30091973', 1, now(), 1, 4);

= Version 2.11 =

-- update the newly created imagemagick reference that is the same as for the preferences
UPDATE users SET imagemagick_options = preferences;
ALTER TABLE users ALTER COLUMN imagemagick_options SET NOT NULL;

= Version 2.12 =

-- we do this just to make sure that that error in the 2.11 release is cleared.
UPDATE users SET imagemagick_options=preferences;

= Version 2.18 =

UPDATE users SET shared = 'f';

= Version 2.34 =

UPDATE users SET hide = 'f';
podoc/users_sql_table.txt · Last modified: 2007/10/19 16:53 by Luud