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 revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
podoc:aperture_sql_table [2007/04/13 09:20] Luudpodoc:aperture_sql_table [2007/04/20 13:37] 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
  
 === Related sequences === === Related sequences ===
Line 21: Line 38:
  
 === 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 64:
 = 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 85:
 = 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.txt · Last modified: 2007/04/20 14:22 by Luud