User Tools

Site Tools


podoc:aperture_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:aperture_sql_table [2007/04/13 05:20]
Luud
podoc:aperture_sql_table [2007/04/20 10:22] (current)
Luud
Line 6: Line 6:
  
 === Description === === Description ===
 +
 +This table contains a list of all valid apertures (eg f/2, f/5.6, etc).
  
 === Purpose === === Purpose ===
 +
 +To enforce referential integrity.
 +
 +Note:  This table will likely be eliminated in the future in favor of direct aperture representation -- this is an unnecessary abstraction.
  
 === Schema === === Schema ===
  
-  create table aperture ( +<code sql> 
-    identifier            integer not null primary key, +create table aperture ( 
-    value                 varchar(10) +  identifier            integer not null primary key, 
-  );+  value                 varchar(10) 
 +);  
 +</code> 
 + 
 +=== References tables === 
 + 
 +None. 
 + 
 +=== Is referenced by tables === 
 + 
 +  * [[lens_type sql table|lens_type]](max_aperture) references identifier 
 +  * [[lens_type sql table|lens_type]](min_aperture) references identifier 
 +  * [[photo_tech sql table|photo_tech]](aperture) references identifier
  
 === Related sequences === === Related sequences ===
Line 21: Line 39:
  
 === Related indexes === === Related indexes ===
 +
 +None.
  
 === Related functions === === Related functions ===
 +
 +None.
  
 === Related views === === Related views ===
 +
 +  * [[view_lens sql view|view_lens]]
 +  * [[view_lens_type sql view|view_lens_type]]
  
 === History === === History ===
Line 40: Line 65:
 = Version 2.5 = = Version 2.5 =
  
-  create table aperture ( +<code sql> 
-    identifier            integer not null primary key, +create table aperture ( 
-    value                 varchar(10) +  identifier            integer not null primary key, 
-  );+  value                 numeric 
 +); 
 +</code> 
 + 
 += Version 2.32 = 
 + 
 +<code sql> 
 +-- Convert aperture from a varchar to a numeric type 
 +alter table aperture add value_num numeric; 
 +update aperture set value_num = value::text::numeric; 
 +alter table aperture drop value; 
 +alter table aperture rename value_num to value; 
 +</code>
  
 == Data change history == == Data change history ==
Line 49: Line 86:
 = Version 2.5 = = Version 2.5 =
  
-<code>+<code sql>
 insert into aperture values (nextval('aperture_id_sequence'), '0.5'); insert into aperture values (nextval('aperture_id_sequence'), '0.5');
 insert into aperture values (nextval('aperture_id_sequence'), '0.75'); insert into aperture values (nextval('aperture_id_sequence'), '0.75');
podoc/aperture_sql_table.1176456019.txt.gz · Last modified: 2007/04/13 05:20 by Luud