CREATE TABLE Party (
  Party_ID varchar(30) NOT NULL,
  FirstName varchar(255) DEFAULT NULL,
  LastName varchar(255) DEFAULT NULL,
  BusinessName varchar(255) DEFAULT NULL,
  TradingName varchar(255) DEFAULT NULL,
  Title int(255) DEFAULT NULL,
  Salutation varchar(255) DEFAULT NULL,
  OtherNames varchar(128) DEFAULT NULL,
  ID_List longtext DEFAULT NULL,
  Addresses longtext DEFAULT NULL,
  Party_InfoAssets longtext DEFAULT NULL,
  PRIMARY KEY (Party_ID),
  UNIQUE KEY unique_Party__ID (Party_ID)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE `PartyPersonalDetails` (
  `PP_ID` varchar(30) NOT NULL,
  `Party_ID` varchar(30) NOT NULL,
  `EmploymentDetails` longtext DEFAULT NULL,
  `Citizenships` longtext DEFAULT NULL,
  `TaxResidency` longtext DEFAULT NULL,
  `Email` longtext DEFAULT NULL,
  `Telephone` longtext DEFAULT NULL,
  `StaffIndicator` tinyint(1) DEFAULT NULL,
  `Staff` longtext DEFAULT NULL,
  `Gender` varchar(255) DEFAULT NULL,
  `DateOfBirth` datetime DEFAULT NULL,
  `Nationality` varchar(255) DEFAULT NULL,
  `Tags` longtext DEFAULT NULL,
  PRIMARY KEY (`PP_ID`),
  UNIQUE KEY `unique_PP_ID` (`PP_ID`),
  KEY `PartyPersonalDetails_Party_FK` (`Party_ID`),
  CONSTRAINT `PartyPersonalDetails_Party_FK` FOREIGN KEY (`Party_ID`) REFERENCES `Party` (`Party_ID`) ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
