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

Related sequences

Related indexes

Related functions

Related views

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
www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0