User Tools

Site Tools


podoc:photo_dupe_sql_table

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

  • submission(photo_dupe) references identifier 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');
podoc/photo_dupe_sql_table.txt · Last modified: 2007/10/31 11:38 by Luud