===== Database Table Description of "photo_dupe" =====
=== Name ===
photo_dupe
=== Description ===
=== Purpose ===
=== Schema ===
create table photo_dupe (
identifier integer not null primary key,
key integer not null,
photo integer not null references photo(identifier),
date_of_creation timestamp, -- date when it was inserted in the system
storage_location varchar(50),
storage_index varchar(10),
remark text, -- dupe remark
version integer not null references photo_version(identifier)
);
=== References other tables ===
* photo references [[photo sql table|photo]](identifier)
* version references [[photo_version sql table|photo_version]](identifier)
=== Is referenced by other tables ===
* [[submission sql table|submission]](photo_dupe) references identifier removed in 2.34
=== Related sequences ===
* [[photo_dupe_id_sequence sql sequence|photo_dupe_id_sequence]]
=== Related indexes ===
* [[photo_dupe_version_idx sql index|photo_dupe_version_idx]]
=== Related functions ===
* [[number_of_dupes sql function|number_of_dupes]]
=== Related views ===
* [[view_photo sql view|view_photo]]
* [[view_submission sql view|view_submission]] removed in 2.34
=== History ===
== Used first ==
Version 2.5
== Used last ==
Still in use
== Schema change history ==
= Version 2.5 =
create table photo_dupe (
identifier integer not null primary key,
key integer not null,
photo integer not null references photo(identifier),
date_of_creation timestamp, -- date when it was inserted in the system
storage_location varchar(50),
storage_index varchar(10),
remark text -- dupe remark
);
= Version 2.34 =
-- Add 'version' to photo_dupe to allow individual versions.
ALTER TABLE photo_dupe
ADD version integer REFERENCES photo_version(identifier);
ALTER TABLE photo_dupe ALTER version SET NOT NULL;
== Data change history =
= Version 2.34 =
UPDATE photo_dupe set version =
(SELECT identifier from photo_version v
WHERE photo_dupe.photo = v.photo AND v.master = 't');