2 -- @description: Tabelle für Shopbilder und zusätzliche Konfiguration und valid_type für Filemanagement
4 -- @depends: release_3_5_0 files shop_parts
7 CREATE TABLE shop_images(
9 file_id INTEGER REFERENCES files(id) ON DELETE CASCADE,
11 thumbnail_content BYTEA,
12 thumbnail_width INTEGER,
13 thumbnail_height INTEGER,
14 thumbnail_content_type TEXT,
15 itime TIMESTAMP DEFAULT now(),
19 CREATE TRIGGER mtime_shop_images BEFORE UPDATE ON shop_images FOR EACH ROW EXECUTE PROCEDURE set_mtime();
21 ALTER TABLE defaults ADD COLUMN doc_storage_for_shopimages text default 'Filesystem';
24 DROP CONSTRAINT valid_type;
26 ADD CONSTRAINT valid_type CHECK (
27 (object_type = 'credit_note' ) OR (object_type = 'invoice' ) OR (object_type = 'sales_order' )
28 OR (object_type = 'sales_quotation' ) OR (object_type = 'sales_delivery_order' ) OR (object_type = 'request_quotation' )
29 OR (object_type = 'purchase_order' ) OR (object_type = 'purchase_delivery_order' ) OR (object_type = 'purchase_invoice' )
30 OR (object_type = 'vendor' ) OR (object_type = 'customer' ) OR (object_type = 'part' )
31 OR (object_type = 'gl_transaction' ) OR (object_type = 'dunning' ) OR (object_type = 'dunning1' )
32 OR (object_type = 'dunning2' ) OR (object_type = 'dunning3' ) OR (object_type = 'draft' )
33 OR (object_type = 'statement' ) OR (object_type = 'shop_image' )