User Tools

Site Tools


podoc:camera_sql_table

Database Table Description of "camera"

Name

camera

Description

A listing of all *specific* cameras that the users owns, complete with serial number. A camera can be associated with a photo.

Purpose

A user should be able to keep track of their cameras.

Schema

CREATE TABLE camera (
  identifier            INTEGER NOT NULL PRIMARY KEY,
  TYPE                  INTEGER REFERENCES camera_type(identifier),
  users                 INTEGER REFERENCES users(identifier),
  serial_number         VARCHAR(20),
  date_of_purchase      TIMESTAMP,
  purchased_new         CHAR(1) CHECK (purchased_new IN ('t', 'f')),
  access_rights         INTEGER NOT NULL REFERENCES access_type(identifier),
  ignore_comment        BOOLEAN NOT NULL
);

References tables

Is referenced by tables

History

Used first

Version 2.5

Used last

Still in use

Schema change history

= Version 2.5 =

CREATE TABLE camera (
  identifier            INTEGER NOT NULL PRIMARY KEY,
  TYPE                  INTEGER REFERENCES camera_type(identifier),
  users                 INTEGER REFERENCES users(identifier),
  serial_number         VARCHAR(20),
  date_of_purchase      TIMESTAMP,
  purchased_new         CHAR(1) CHECK (purchased_new IN ('t', 'f')),
  access_rights         INTEGER NOT NULL REFERENCES access_type(identifier)
);

= Version 2.34 =

-- Add a flag to ignore the camera's user comments
 
ALTER TABLE camera ADD ignore_comment BOOLEAN;
ALTER TABLE camera ALTER ignore_comment SET NOT NULL;
Data change history

= Version 2.34 =

UPDATE camera SET ignore_comment = 'f';
podoc/camera_sql_table.txt · Last modified: 2007/10/19 16:05 by Luud