-- Create/Recreate check constraints 
alter table I_PRICELIST
  drop constraint PRICETYPE_VAL_RENTPRICETYPE;
alter table I_PRICELIST
  add constraint PRICETYPE_VAL_RENTPRICETYPE
  check (PRICELISTTYPE <> 2 or (RENTPRICETYPE BETWEEN 1 AND 7 AND PRICELISTTYPE = 2));
alter table I_PRICELIST
  drop constraint PRICETYPE_VAL_WASHPRICETYPE;
alter table I_PRICELIST
  add constraint PRICETYPE_VAL_WASHPRICETYPE
  check (PRICELISTTYPE <> 1 OR (WASHPRICETYPE BETWEEN 1 AND 4 AND PRICELISTTYPE = 1));

-- Add/modify columns 
alter table I_PRODUCTLISTPERCUSTOMER add PRICEUSAGE number default 0 not null;
-- Add comments to the columns 
comment on column I_PRODUCTLISTPERCUSTOMER.PRICEUSAGE
  is '0 = Not applicable
1 = Split price
2 = Rent price only
3 = Wash price only';

-- Create/Recreate check constraints 
alter table I_PRODUCTLISTPERCUSTOMER
  add constraint I_PLPC_PRICEUSAGE
  check (PRICEUSAGE BETWEEN 0 AND 4);


