Revision c9f6c754
Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt
SL/DB/MetaSetup/Reclamation.pm | ||
---|---|---|
notes => { type => 'text' },
|
||
payment_id => { type => 'integer' },
|
||
record_number => { type => 'text', not_null => 1 },
|
||
record_type => { type => 'enum', check_in => [ 'sales_reclamation', 'purchase_reclamation' ], db_type => 'reclamation_types', not_null => 1 },
|
||
reqdate => { type => 'date' },
|
||
salesman_id => { type => 'integer' },
|
||
shippingpoint => { type => 'text' },
|
sql/Pg-upgrade2/reclamation_type.sql | ||
---|---|---|
-- @tag: reclamation_type
|
||
-- @description: Persistente Typen in Reklamationen
|
||
-- @depends: release_3_7_0
|
||
|
||
CREATE TYPE reclamation_types AS ENUM (
|
||
'sales_reclamation',
|
||
'purchase_reclamation'
|
||
);
|
||
|
||
ALTER TABLE reclamations ADD COLUMN record_type reclamation_types;
|
||
|
||
UPDATE reclamations SET record_type = 'sales_reclamation' WHERE customer_id IS NOT NULL;
|
||
UPDATE reclamations SET record_type = 'purchase_reclamation' WHERE vendor_id IS NOT NULL;
|
||
|
||
ALTER TABLE reclamations ALTER COLUMN record_type SET NOT NULL;
|
||
|
||
|
Auch abrufbar als: Unified diff
DB::Reclamation: Persistenter Record-Type