User Tools

Site Tools


podoc:camera_sql_table

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
podoc:camera_sql_table [2007/04/12 12:32]
Luud
podoc:camera_sql_table [2007/10/19 20:05] (current)
Luud
Line 1: Line 1:
-===== Database Table Description =====+===== Database Table Description of "camera" =====
  
 === Name === === Name ===
 +
 +camera
  
 === Description === === Description ===
 +
 +A listing of all *specific* cameras that the users owns, complete with serial number. A camera can be associated with a photo.
  
 === Purpose === === Purpose ===
 +
 +A user should be able to keep track of their cameras.
  
 === Schema === === Schema ===
 +
 +<code sql>
 +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
 +);
 +</code>
 +
 +=== References tables ===
 +
 +  * type references [[camera_type sql table|camera_type]](identifier)
 +  * users references [[users sql table|users]](identifier)
 +  * access_rights references [[access_type sql table|access_type]](identifier)
 +
 +=== Is referenced by tables ===
 +
 +  * [[photo_tech sql table|photo_tech]](camera) references identifier
  
 === Related sequences === === Related sequences ===
 +
 +  * [[camera_id_sequence sql sequence|camera_id_sequence]]
  
 === Related indexes === === Related indexes ===
 +
 +  * [[camera_type_idx sql index|camera_type_idx]]
 +  * [[camera_users_idx sql index|camera_users_idx]]
  
 === Related functions === === Related functions ===
 +
 +  * [[count_equipment_by_user sql function|count_equipment_by_user]]
 +  * [[number_of_camera_references sql function|number_of_camera_references]]
  
 === Related views === === Related views ===
 +
 +  * [[view_camera sql view|view_camera]]
  
 === History === === History ===
Line 27: Line 66:
 Still in use Still in use
  
-== Change history ==+== Schema change history ==
  
 = Version 2.5 = = Version 2.5 =
  
-  create table ... +<code sql> 
-    ...   +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) 
 +); 
 +</code> 
 + 
 += Version 2.34 = 
 + 
 +<code sql> 
 +-- Add a flag to ignore the camera's user comments 
 + 
 +alter table camera add ignore_comment boolean; 
 +</code> 
 + 
 +<code sql> 
 +alter table camera alter ignore_comment set not null; 
 +</code> 
 + 
 +== Data change history == 
 + 
 += Version 2.34 = 
 + 
 +<code sql> 
 +update camera set ignore_comment = 'f'; 
 +</code>
podoc/camera_sql_table.1176381142.txt.gz · Last modified: 2007/04/12 12:32 by Luud