Symfony 1.4 Propel:这个定义是什么意思?

时间:2012-01-16 13:33:08

标签: php symfony1 propel

我正在尝试构建表格方案,但看起来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自己添加了它。

0 个答案:

没有答案