User Tools

Site Tools


podoc:photo_dupe_sql_table

This is an old revision of the document!


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

References other tables

  • photo references photo(identifier)

Is referenced by other tables

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               INTEGER NOT NULL REFERENCES photo_version(identifier)
  );

= 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.1192823975.txt.gz · Last modified: 2007/10/19 19:59 by Luud