CREATE TABLE `VEHICLE` (
  `ID_INTERNAL` int(11) unsigned NOT NULL auto_increment,
  `PLATE_NUMBER` varchar(10) NOT NULL,
  `VEHICLE_MAKE` varchar(20) NOT NULL,
  `PROPERTY_REGISTRY_DELIVERY_TYPE` varchar(50) default NULL,
  `INSURANCE_DELIVERY_TYPE` varchar(50) default NULL,
  `OWNER_ID_DELIVERY_TYPE` varchar(50) default NULL,
  `AUTHORIZATION_DECLARATION_DELIVERY_TYPE` varchar(50) default NULL,
  `KEY_PARKING_REQUEST` int(11) unsigned default NULL,
  `KEY_ROOT_DOMAIN_OBJECT` int(11) NOT NULL default '1',
  `KEY_PARKING_PARTY` int(11) unsigned default NULL,
  PRIMARY KEY  (`ID_INTERNAL`),
  KEY `KEY_PARKING_REQUEST` (`KEY_PARKING_REQUEST`),
  KEY `KEY_ROOT_DOMAIN_OBJECT` (`KEY_ROOT_DOMAIN_OBJECT`),
  KEY `KEY_PARKING_PARTY` (`KEY_PARKING_PARTY`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

CREATE TABLE `NEW_PARKING_DOCUMENT` (
  `ID_INTERNAL` int(11) unsigned NOT NULL auto_increment,
  `PARKING_DOCUMENT_TYPE` varchar(50) NOT NULL default '',
  `KEY_PARKING_REQUEST` int(11) unsigned default NULL,
  `KEY_PARKING_FILE` int(11) unsigned NOT NULL default '0',
  `KEY_VEHICLE` int(11) unsigned default NULL,
  `KEY_ROOT_DOMAIN_OBJECT` int(11) NOT NULL default '1',
  `KEY_PARKING_PARTY` int(11) unsigned default NULL,
  PRIMARY KEY  (`ID_INTERNAL`),
  KEY `KEY_PARKING_FILE` (`KEY_PARKING_FILE`),
  KEY `KEY_VEHICLE` (`KEY_VEHICLE`),  
  KEY `KEY_PARKING_REQUEST` (`KEY_PARKING_REQUEST`),
  KEY `KEY_ROOT_DOMAIN_OBJECT` (`KEY_ROOT_DOMAIN_OBJECT`),
  KEY `KEY_PARKING_PARTY` (`KEY_PARKING_PARTY`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

alter table PARKING_PARTY add column KEY_DRIVER_LICENSE_DOCUMENT int(11) default NULL;
alter table PARKING_PARTY add column DRIVER_LICENSE_DELIVERY_TYPE varchar(50) default NULL;
alter table PARKING_REQUEST add column KEY_DRIVER_LICENSE_DOCUMENT int(11) default NULL;
alter table PARKING_REQUEST add column DRIVER_LICENSE_DELIVERY_TYPE varchar(50) default NULL;
alter table PARKING_REQUEST modify FIRST_CAR_PLATE_NUMBER varchar(10) default NULL;
alter table PARKING_REQUEST modify FIRST_CAR_MAKE varchar(20) default NULL;
alter table FILE add column KEY_NEW_PARKING_DOCUMENT int(11) default NULL;