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

Is referenced by other tables

Related sequences

Related indexes

Related functions

Related views

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');