-- --------------------------------------------------------
-- Server OS:                    Linux
-- HeidiSQL Version:             11.3.0.6295
-- --------------------------------------------------------



-- Dumping database structure for example_com
CREATE DATABASE IF NOT EXISTS `example_com` /*!40100 DEFAULT CHARACTER SET utf8mb4 */;
USE `example_com`;

-- Dumping structure for table example_com.apAppointment
CREATE TABLE IF NOT EXISTS `apAppointment` (
  `Id` binary(16) NOT NULL,
  `StartDateTime` datetime DEFAULT NULL,
  `DurationInMinutes` int(3) NOT NULL,
  `TreatmentTypeId` binary(16) DEFAULT NULL,
  `ClinicId` binary(16) NOT NULL,
  `AppointmentState` varchar(255) NOT NULL,
  `HealthProfessionalId` binary(16) NOT NULL,
  `PatientId` binary(16) DEFAULT NULL,
  `ValidFrom` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `ValidSince` datetime(6) DEFAULT NULL,
  `Description` varchar(255) DEFAULT NULL,
  `InTempList` tinyint(1) DEFAULT 0,
  `IsInternal` tinyint(1) DEFAULT 0,
  `ReservationToken` varchar(1000) DEFAULT NULL,
  `Archived` tinyint(1) DEFAULT 0,
  `SequenceID` varchar(255) NOT NULL,
  `SequenceIndex` int(11) NOT NULL,
  `EndDateTime` datetime(6) DEFAULT NULL,
  `IsRatingInvitationSent` tinyint(1) DEFAULT 0,
  `RatingId` binary(16) DEFAULT NULL,
  PRIMARY KEY (`Id`),
  UNIQUE KEY `apAppointment_sequence` (`SequenceID`),
  KEY `AppointmentState` (`AppointmentState`),
  KEY `PatientId` (`PatientId`),
  KEY `CaregiverId` (`HealthProfessionalId`),
  KEY `ClinicId` (`ClinicId`),
  KEY `TreatmentTypeId` (`TreatmentTypeId`),
  KEY `apAppointment_idx_1` (`StartDateTime`),
  KEY `apAppointment_idx_2` (`AppointmentState`),
  KEY `RatingId` (`RatingId`),
  CONSTRAINT `apAppointment_ibfk_2` FOREIGN KEY (`PatientId`) REFERENCES `paPatient` (`Id`),
  CONSTRAINT `apAppointment_ibfk_3` FOREIGN KEY (`HealthProfessionalId`) REFERENCES `clHealthProfessional` (`Id`),
  CONSTRAINT `apAppointment_ibfk_4` FOREIGN KEY (`ClinicId`) REFERENCES `clClinic` (`Id`),
  CONSTRAINT `apAppointment_ibfk_5` FOREIGN KEY (`TreatmentTypeId`) REFERENCES `clTreatmentType` (`Id`),
  CONSTRAINT `apAppointment_ibfk_6` FOREIGN KEY (`RatingId`) REFERENCES `apRating` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3;

-- Dumping data for table example_com.apAppointment: ~1,352 rows (approximately)
INSERT INTO `apAppointment` (`Id`, `StartDateTime`, `DurationInMinutes`, `TreatmentTypeId`, `ClinicId`, `AppointmentState`, `HealthProfessionalId`, `PatientId`, `ValidFrom`, `ValidSince`, `Description`, `InTempList`, `IsInternal`, `ReservationToken`, `Archived`, `SequenceID`, `SequenceIndex`, `EndDateTime`, `IsRatingInvitationSent`, `RatingId`) VALUES
	(_binary 0x002c9fa672be4d568fb32e89b83e9b4f, '2022-06-22 09:30:00', 30, _binary 0x0265603ee24b4a6fbed03c0b15ab93bc, _binary 0x743cbdd450d740598c198569f51b35ca, 'APPROVAL_PENDING', _binary 0xebd7c61385e44d76b73f3eee7cb6a2a2, _binary 0x5a4ac82a34074cb3b349d0feea43f0c2, '2022-06-17 13:29:30', NULL, NULL, 0, 0, NULL, 0, 'fbee2594-c148-462d-ad89-b53a0cfd7c19', 0, '2022-06-22 10:00:00.000000', 0, NULL),
...
	(_binary 0xffdbae3df9414b7e95b7f1cd08f42888, '2022-04-11 14:15:00', 25, _binary 0xd05460837c9a4d9ba5908ed83564b065, _binary 0x3cb566d7a70246b6a64d4ed3dca47461, 'CANCELLED', _binary 0xd3279062eede4b378bd54665dee2929b, _binary 0x8d7d53e19984433e89d0f45f898c990c, '2022-03-30 11:01:09', NULL, NULL, 0, 0, NULL, 0, 'a704b3c7-0405-4cb6-82b4-79d14c13d4e1', 6, '2022-04-11 14:40:00.000000', 0, NULL);

...

