从可用表创建实体(带配置文件)的最佳方法是什么?
想象我有一个像这样的创建表查询:
CREATE TABLE IF NOT EXISTS `mytable`.`task` (
`id` INT NOT NULL AUTO_INCREMENT,
`title` VARCHAR(45) NOT NULL,
`description` TINYTEXT NOT NULL,
`due_date` DATETIME NOT NULL,
`attachment` TINYINT(1) NULL,
`project_id` INT NULL,
`user_id` INT NULL,
PRIMARY KEY (`id`),
INDEX `fk_task_1_idx` (`project_id` ASC),
INDEX `fk_task_2_idx` (`user_id` ASC),
CONSTRAINT `fk_task_1`
FOREIGN KEY (`project_id`)
REFERENCES `mava`.`project` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION,
CONSTRAINT `fk_task_2`
FOREIGN KEY (`user_id`)
REFERENCES `mava`.`user` (`id`)
ON DELETE NO ACTION
ON UPDATE NO ACTION)
ENGINE = InnoDB
有什么办法可以从这个查询中生成task.orm.yml文件。 我使用symfony和doctrine,我已经定义了一堆表。所以我需要从它们生成实体。 感谢