DROP TABLE IF EXISTS PAYMENT_CODE;
CREATE TABLE PAYMENT_CODE (
  ID_INTERNAL int(11) unsigned NOT NULL auto_increment,
  WHEN_CREATED datetime NOT NULL,
  CODE VARCHAR(9) NOT NULL,
  STATE VARCHAR(255) NOT NULL,
  TYPE VARCHAR(255) NOT NULL,
  START_DATE VARCHAR(10) NOT NULL,
  END_DATE VARCHAR(10) NOT NULL,
  MIN_AMOUNT VARCHAR(255) NOT NULL,
  MAX_AMOUNT VARCHAR(255) NOT NULL,
  OJB_CONCRETE_CLASS VARCHAR(255) NOT NULL,
  KEY_ACCOUNTING_EVENT int(11) NULL,
  KEY_INSTALLMENT int(11) NULL,
  KEY_STUDENT int(11) NOT NULL,
  KEY_ROOT_DOMAIN_OBJECT int(11) NOT NULL default '1',
  PRIMARY KEY  (ID_INTERNAL),
  KEY (KEY_ROOT_DOMAIN_OBJECT),
  KEY (KEY_ACCOUNTING_EVENT),  
  KEY (KEY_INSTALLMENT),
  KEY (KEY_STUDENT),
  UNIQUE (CODE)
) ENGINE=InnoDB;
