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/18 12:46]
pizza description.
podoc:camera_sql_table [2007/10/19 20:05] (current)
Luud
Line 7: Line 7:
 === Description === === Description ===
  
-A listing of all *specific* cameras that the users own, complete with serial number.   A camera can be associated with a photo.+A listing of all *specific* cameras that the users owns, complete with serial number. A camera can be associated with a photo.
  
 === Purpose === === Purpose ===
Line 15: Line 15:
 === Schema === === Schema ===
  
-  create table camera ( +<code sql> 
-    identifier            integer not null primary key, +create table camera ( 
-    type                  integer references camera_type(identifier), +  identifier            integer not null primary key, 
-    users                 integer references users(identifier), +  type                  integer references camera_type(identifier), 
-    serial_number         varchar(20), +  users                 integer references users(identifier), 
-    date_of_purchase      timestamp, +  serial_number         varchar(20), 
-    purchased_new         char(1) check (purchased_new in ('t', 'f')), +  date_of_purchase      timestamp, 
-    access_rights         integer not null references access_type(identifier) +  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 ===
Line 35: Line 48:
  
 === 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 48: Line 66:
 Still in use Still in use
  
-== Change history ==+== Schema change history ==
  
 = Version 2.5 = = Version 2.5 =
  
-  create table camera ( +<code sql> 
-    identifier            integer not null primary key, +create table camera ( 
-    type                  integer references camera_type(identifier), +  identifier            integer not null primary key, 
-    users                 integer references users(identifier), +  type                  integer references camera_type(identifier), 
-    serial_number         varchar(20), +  users                 integer references users(identifier), 
-    date_of_purchase      timestamp, +  serial_number         varchar(20), 
-    purchased_new         char(1) check (purchased_new in ('t', 'f')), +  date_of_purchase      timestamp, 
-    access_rights         integer not null references access_type(identifier) +  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.1176900362.txt.gz · Last modified: 2007/04/18 12:46 by pizza