Database Table Description of "rating"

Name

rating

Description

Purpose

Schema

create table rating (
  identifier            integer not null primary key,
  photo                 integer not null references photo(identifier),
  users                 integer not null references users(identifier),
  date_of_creation      timestamp,
  value                 integer not null,
  comment               text,
  version               integer not null references photo_version(identifier);
);

References tables

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

Is referenced by tables

None.

Related sequences

Related indexes

Related functions

None.

Related views

History

Used first

Version 2.5

Used last

Still in use

Schema change history

= Version 2.5 =

CREATE TABLE rating (
  identifier            integer NOT NULL PRIMARY KEY,
  photo                 integer NOT NULL REFERENCES photo(identifier),
  users                 integer NOT NULL REFERENCES users(identifier),
  date_of_creation      timestamp,
  value                 integer NOT NULL
);

= Version 2.6 =

ALTER TABLE rating ADD COLUMN comment text;

= Version 2.34 =

-- Add 'version' to rating to allow individual versions.
ALTER TABLE rating
  ADD version integer REFERENCES photo_version(identifier);
ALTER TABLE rating ALTER version SET NOT NULL;
Data change history

= Version 2.34 =

-- Add 'version' to rating to allow individual versions.
UPDATE rating SET version =
   (SELECT identifier FROM photo_version v
    WHERE rating.photo = v.photo AND v.master = 't');
podoc/rating_sql_table.txt · Last modified: 2007/10/19 15:39 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