我正在尝试构建表格方案,但看起来Propel不想接受没有ID的表格。如果我有这个:
notifications:
_attributes: { phpName: Notifications }
auction_id: { type: integer, size: '10', primarykey: true, required: true, defaultvalue: '0', foreignTable: auctions, foreignReference: id }
alertwhenitsover: { type: tinyint, size: '1', required: true, defaultvalue: '0' }
生成的SQL:
CREATE TABLE `notifications`
(
`auction_id` INTEGER(10) default 0 NOT NULL,
`alertwhenitsover` TINYINT(1) default 0 NOT NULL,
`id` INTEGER NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`auction_id`,`id`),
CONSTRAINT `notifications_FK_1`
FOREIGN KEY (`auction_id`)
REFERENCES `auctions` (`id`)
)Engine=InnoDB
这是一个糟糕的定义。 id
来自哪里?它看起来Symfony自己添加了它。