User Tools

Site Tools


podoc:photo_version_sql_table

Differences

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

Link to this comparison view

Next revision
Previous revision
podoc:photo_version_sql_table [2007/04/13 10:01] – created Luudpodoc:photo_version_sql_table [2007/10/19 20:02] (current) Luud
Line 11: Line 11:
 === Schema === === Schema ===
  
-<code>+<code sql>
 create table photo_version ( create table photo_version (
   identifier            integer not null primary key,   identifier            integer not null primary key,
Line 17: Line 17:
   photo                 integer not null references photo(identifier),   photo                 integer not null references photo(identifier),
   master                char(1) check (master in ('t', 'f')),   master                char(1) check (master in ('t', 'f')),
-  small_image_path      varchar(500), 
-  medium_image_path     varchar(500), 
-  large_image_path      varchar(500), 
   date_of_creation      timestamp,   date_of_creation      timestamp,
-  comment               text+  comment               text
 +  original_image_name   varchar(500), 
 +  colorspace            integer not null, 
 +  orientation           integer not null references orientations(identifier),, 
 +  date_changed          timestamp without time zone
 ); );
 </code> </code>
 +
 +=== References other tables ===
 +
 +  * photo references [[photo sql table|photo]](identifier)
 +  * orientation references [[orientations sql table|orientations]](identifier)
 +
 +=== Is referenced by other tables ===
 +
 +  * <del>[[imagemagick_composite_options sql table|imagemagick_composite_options]](photo_version) references identifier</del> removed in 2.34
 +  * [[photo_dupe sql table]](version) references identifier
  
 === Related sequences === === Related sequences ===
Line 30: Line 41:
  
 === Related indexes === === Related indexes ===
 +
 +  * [[photo_version_photo_idx sql index|photo_version_photo_idx]]
 +  * [[photo_version_photo sql index|photo_version_photo]]
  
 === Related functions === === Related functions ===
 +
 +  * [[count_photo_versions sql function|count_photo_versions]]
 +  * [[count_photo_versions_by_user sql function|count_photo_versions_by_user]]
  
 === Related views === === Related views ===
  
- * [[view_photo sql view|view_photo]] +  * [[view_photo sql view|view_photo]] 
- * [[view_random_photo sql view|view_random_photo]]+  * [[view_random_photo sql view|view_random_photo]]
  
 === History === === History ===
Line 52: Line 69:
 = Version 2.7 = = Version 2.7 =
  
-<code>+<code sql>
 create table photo_version ( create table photo_version (
   identifier            integer not null primary key,   identifier            integer not null primary key,
Line 66: Line 83:
 </code> </code>
  
-= Data change history =+= Version 2.13 = 
 + 
 +<code sql> 
 +alter table photo_version add column original_image_name varchar(500); 
 +</code> 
 + 
 += Version 2.26 = 
 + 
 +<code sql> 
 +alter table photo_version add column colorspace integer; 
 +update photo_version set colorspace = 1 where colorspace is null; 
 +alter table photo_version alter colorspace set not null; 
 + 
 +alter table photo_version add column orientation integer references orientations(identifier); 
 +update photo_version set orientation = 1 where orientation is null; 
 +alter table photo_version alter orientation set not null; 
 +</code> 
 + 
 += Version 2.34 = 
 + 
 +<code sql> 
 +alter table photo_version add date_changed timestamp without time zone; 
 +</code> 
 + 
 +== Data change history ==
  
 = Version 2.7 = = Version 2.7 =
  
-<code>+<code sql>
 -- populate version control table -- populate version control table
 insert into photo_version insert into photo_version
   select (nextval('photo_version_id_sequence')), 1, identifier, 't', small_image_path, medium_image_path, large_image_path, now(), '' from photo;   select (nextval('photo_version_id_sequence')), 1, identifier, 't', small_image_path, medium_image_path, large_image_path, now(), '' from photo;
 +</code>
 +
 += Version 2.13 =
 +
 +<code sql>
 +update photo_version set original_image_name = 'file';
 +</code>
 +
 += Version 2.34 =
 +
 +<code sql>
 +alter table photo_version drop small_image_path;
 +alter table photo_version drop medium_image_path;
 +alter table photo_version drop large_image_path;
 </code> </code>
  
podoc/photo_version_sql_table.1176458470.txt.gz · Last modified: 2007/04/13 10:01 by Luud