--i-table changes.

--1. Create/Recreate primary, unique and foreign key constraints 
--  First delete to make sure FK can be made.
DELETE FROM I_STOCKROOMQUANTITY;
alter table I_STOCKROOMQUANTITY
  add constraint I_STOCKROOMQUANTITY_STOCKROOM foreign key (STOCKROOMCODE)
  references stockroom (CODE);

--2. Add/modify columns 
alter table I_PRODUCT add PRODUCTRANKINGPRIO number default 1 not null;
-- Add comments to the columns 
comment on column I_PRODUCT.PRODUCTRANKINGPRIO
  is 'ProductRanking.prio default 1';
  
--3. Add/modify columns 
alter table I_CONTRACTCUSTOMER add CONTRACTUSAGE number default 0 not null;
-- Add comments to the columns 
comment on column I_CONTRACTCUSTOMER.CONTRACTUSAGE
  is 'Must be between 0-1';
-- Create/Recreate check constraints 
alter table I_CONTRACTCUSTOMER
  add constraint I_CONTRACTCUSTOMER_CNTRUSAGE
  check (CONTRACTUSAGE BETWEEN 0 AND 1);
  
--4. Add/modify columns 
alter table I_CUSTOMER add CODELABELLAYOUTCODE varchar2(6);
alter table I_CUSTOMER add CODELABELLAYOUTDESC varchar2(60);
alter table I_CUSTOMER add NAMELABELLAYOUTCODE varchar2(6);
alter table I_CUSTOMER add NAMELABELLAYOUTDESC varchar2(60);   
