shop_item
CREATE TABLE photo_format ( identifier INTEGER NOT NULL PRIMARY KEY, users INTEGER REFERENCES users(identifier), date_of_creation TIMESTAMP, date_of_last_edit TIMESTAMP, description VARCHAR(200), category INTEGER NOT NULL REFERENCES shop_category(identifier) );
None.
None.
None.
Version 2.19
Version 2.33
= 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;
= Version 2.34 =
DROP TABLE shop_item;