Database Table Description of "album_content"

Name

album_content

Description

This table keeps track of what photos are in which albums.

Purpose

Unlike folders, it's possible for a photo to be in more than one album. This table allows for that.

Schema

CREATE TABLE album_content (
  identifier            integer NOT NULL PRIMARY KEY,
  photo                 integer NOT NULL REFERENCES photo(identifier),
  album                 integer NOT NULL REFERENCES album(identifier),
  version               integer NOT NULL REFERENCES photo_version(identifier),
  date_changed          timestamp without time zone
);

References tables

  • album references album(identifier)
  • photo references photo(identifier)
  • version references photo_version(identifier)

Is referenced by tables

None.

Related sequences

Related indexes

Related functions

Related views

None.

History

Used first

Version 2.5

Used last

Still in use

Schema change history

= Version 2.5 =

CREATE TABLE album_content (
  identifier            integer NOT NULL PRIMARY KEY,
  photo                 integer NOT NULL REFERENCES photo(identifier),
  album                 integer NOT NULL REFERENCES album(identifier)
);

= Version 2.34 =

-- Add 'version' to album_content to allow individual versions.
ALTER TABLE album_content
  ADD version integer REFERENCES photo_version(identifier);
ALTER TABLE album_content ALTER version SET NOT NULL;
alter table album_content add date_added timestamp without time zone;

== Data change history =

= Version 2.34 =

UPDATE album_content SET version =
   (SELECT identifier FROM photo_version v
    WHERE album_content.photo = v.photo AND v.master = 't');
podoc/album_content_sql_table.txt · Last modified: 2007/10/19 16:55 by Luud
www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0