$this->
registerDefinition(SubDefinition::
class),
$this->
getContainer()->
get(EntityReaderInterface::
class),
$this->
getContainer()->
get(VersionManager::
class),
$this->
getContainer()->
get(EntitySearcherInterface::
class),
$this->
getContainer()->
get(EntityAggregatorInterface::
class),
$this->
getContainer()->
get('event_dispatcher'
),
$this->
getContainer()->
get(EntityLoadedEventFactory::
class) );
$this->
registerDefinition(SubCascadeDefinition::
class);
$this->connection->
rollBack();
$this->connection->
executeStatement('
DROP TABLE IF EXISTS `root_sub_many`;
DROP TABLE IF EXISTS `root_sub_cascade`;
DROP TABLE IF EXISTS `root_sub`;
DROP TABLE IF EXISTS `root`;
CREATE TABLE `root` (
`id` binary(16) NOT NULL,
`version_id` binary(16) NOT NULL,
`name` varchar(255) NOT NULL,
`created_at` DATETIME(3) NOT NULL,
`updated_at` DATETIME(3) NULL,
PRIMARY KEY `primary` (`id`, `version_id`)
);
CREATE TABLE `root_sub` (
`id` binary(16) NOT NULL,
`version_id` binary(16) NOT NULL,
`root_version_id` binary(16),
`root_id` binary(16),
`name` varchar(255) NULL,
`stock` int NULL,
`created_at` DATETIME(3) NOT NULL,
`updated_at` DATETIME(3) NULL,
PRIMARY KEY `primary` (`id`, `version_id`)
);
CREATE TABLE `root_sub_cascade` (
`id` binary(16) NOT NULL,
`version_id` binary(16) NOT NULL,
`root_version_id` binary(16),
`root_id` binary(16),
`name` varchar(255) NULL,
`stock` int NULL,
`created_at` DATETIME(3) NOT NULL,
`updated_at` DATETIME(3) NULL,
PRIMARY KEY `primary` (`id`, `version_id`)
);
CREATE TABLE `root_sub_many` (
`id` binary(16) NOT NULL,
`version_id` binary(16) NOT NULL,
`root_sub_version_id` binary(16) NOT NULL,
`root_sub_id` binary(16) NOT NULL,
`name` varchar(255) NULL,
`created_at` DATETIME(3) NOT NULL,
`updated_at` DATETIME(3) NULL,
PRIMARY KEY `primary` (`id`, `version_id`)
);
ALTER TABLE `root_sub`
ADD FOREIGN KEY (`root_id`, `root_version_id`) REFERENCES `root` (`id`, `version_id`) ON DELETE RESTRICT ON UPDATE NO ACTION;
ALTER TABLE `root_sub_cascade`
ADD FOREIGN KEY (`root_id`, `root_version_id`) REFERENCES `root` (`id`, `version_id`) ON DELETE CASCADE ON UPDATE NO ACTION;
ALTER TABLE `root_sub_many`
ADD FOREIGN KEY (`root_sub_id`, `root_sub_version_id`) REFERENCES `root_sub` (`id`, `version_id`) ON DELETE RESTRICT ON UPDATE NO ACTION;
'
);