Database Table Description of "photo_format"

Dropped in 2.19. Replaced by shop_item.

Name

photo_format

Description

Purpose

Schema

CREATE TABLE photo_format (
  identifier            integer NOT NULL PRIMARY KEY,
  users                 integer REFERENCES users(identifier),
  width                 varchar(100),
  height                varchar(100),
  date_of_creation      timestamp,
  date_of_last_edit     timestamp
);

References tables

  • users references users(identifier)

Is referenced by tables

None.

Related sequences

Related indexes

None.

Related functions

None.

Related views

None.

History

Used first

Version 2.8

Used last

Version 2.18

Schema change history

= Version 2.8 =

CREATE TABLE photo_format (
  identifier            integer NOT NULL PRIMARY KEY,
  users                 integer REFERENCES users(identifier),
  width                 varchar(100),
  height                varchar(100),
  date_of_creation      timestamp,
  date_of_last_edit     timestamp
);

= Version 2.19 =

ALTER TABLE photo_format ADD COLUMN description varchar(200);
ALTER TABLE photo_format ADD COLUMN category integer REFERENCES shop_category(identifier);
 
-- and migrate existing photo_formats to this category
UPDATE photo_format SET category = shop_category.identifier FROM shop_category WHERE photo_format.users = shop_category.users;
 
-- now that we have the categories updated set them not null
ALTER TABLE photo_format ALTER COLUMN category SET NOT NULL;
 
-- update the photo_format so that we have only one description field
UPDATE photo_format SET description = width || 'x' || height;
 
-- drop old columns from photo_format
ALTER TABLE photo_format DROP COLUMN width;
ALTER TABLE photo_format DROP COLUMN height;
 
ALTER TABLE photo_format RENAME TO shop_item;
Data change history
podoc/photo_format_sql_table.txt · Last modified: 2007/04/20 10: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