===== Database Table Description of "photo_version" ===== === Name === photo_version === Description === === Purpose === === Schema === create table photo_version ( identifier integer not null primary key, key integer not null, photo integer not null references photo(identifier), master char(1) check (master in ('t', 'f')), date_of_creation timestamp, comment text, original_image_name varchar(500), colorspace integer not null, orientation integer not null references orientations(identifier),, date_changed timestamp without time zone ); === References other tables === * photo references [[photo sql table|photo]](identifier) * orientation references [[orientations sql table|orientations]](identifier) === Is referenced by other tables === * [[imagemagick_composite_options sql table|imagemagick_composite_options]](photo_version) references identifier removed in 2.34 * [[photo_dupe sql table]](version) references identifier === Related sequences === * [[photo_version_id_sequence sql sequence|photo_version_id_sequence]] === Related indexes === * [[photo_version_photo_idx sql index|photo_version_photo_idx]] * [[photo_version_photo sql index|photo_version_photo]] === Related functions === * [[count_photo_versions sql function|count_photo_versions]] * [[count_photo_versions_by_user sql function|count_photo_versions_by_user]] === Related views === * [[view_photo sql view|view_photo]] * [[view_random_photo sql view|view_random_photo]] === History === == Used first == Version 2.7 == Used last == Still in use == Schema change history == = Version 2.7 = create table photo_version ( identifier integer not null primary key, key integer not null, photo integer not null references photo(identifier), 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, comment text ); = Version 2.13 = alter table photo_version add column original_image_name varchar(500); = Version 2.26 = 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; = Version 2.34 = alter table photo_version add date_changed timestamp without time zone; == Data change history == = Version 2.7 = -- populate version control table 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; = Version 2.13 = update photo_version set original_image_name = 'file'; = Version 2.34 = alter table photo_version drop small_image_path; alter table photo_version drop medium_image_path; alter table photo_version drop large_image_path;