DROP TABLE IF EXISTS INSTALLMENT;
CREATE TABLE INSTALLMENT (
  ID_INTERNAL int(11) unsigned NOT NULL auto_increment,
  KEY_PAYMENT_PLAN int(11) NOT NULL,
  WHEN_CREATED datetime NOT NULL,
  AMOUNT VARCHAR(255) NOT NULL,
  PENALTY_PERCENTAGE VARCHAR(255) NOT NULL,
  START_DATE varchar(10) NOT NULL,
  END_DATE varchar(10) NOT NULL,
  OJB_CONCRETE_CLASS VARCHAR(255) NOT NULL,
  WHEN_START_TO_APPLY_PENALTY varchar(10) NULL,
  MAX_MONTHS_TO_APPLY_PENALTY int(4) NULL,
  INSTALLMENT_ORDER int(2) NOT NULL,
  KEY_ROOT_DOMAIN_OBJECT int(11) NOT NULL default '1',
  PRIMARY KEY  (ID_INTERNAL),
  KEY (KEY_ROOT_DOMAIN_OBJECT),
  KEY (KEY_PAYMENT_PLAN)
) ENGINE=InnoDB;
