Symfony1 无法为没有主键的模型生成模块
我有一个标题表/模型,还有一个标题模块。当我转到标题模块时,它在过去工作得很好,现在它给了我以下错误:Symfony1 无法为没有主键的模型生成模块,symfony1,doctrine,Symfony1,Doctrine,我有一个标题表/模型,还有一个标题模块。当我转到标题模块时,它在过去工作得很好,现在它给了我以下错误: Cannot generate a module for a model without a primary key (Heading) 这对我来说很奇怪,因为标题的schema.yml如下所示: Heading: connection: doctrine tableName: heading columns: id: type: integer(8)
Cannot generate a module for a model without a primary key (Heading)
这对我来说很奇怪,因为标题的schema.yml如下所示:
Heading:
connection: doctrine
tableName: heading
columns:
id:
type: integer(8)
fixed: false
unsigned: false
primary: true
autoincrement: true
referenced_table_name:
type: string(255)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
column_name:
type: string(255)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
label:
type: string(255)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
position:
type: integer(4)
fixed: false
unsigned: true
primary: false
notnull: true
autoincrement: false
import_profile_id:
type: integer(8)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
note:
type: string()
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
created_at:
type: timestamp(25)
fixed: false
unsigned: false
primary: false
default: '0000-00-00 00:00:00'
notnull: true
autoincrement: false
updated_at:
type: timestamp(25)
fixed: false
unsigned: false
primary: false
default: '0000-00-00 00:00:00'
notnull: true
autoincrement: false
relations:
ImportProfile:
local: import_profile_id
foreign: id
type: one
TotalFromFile:
local: id
foreign: heading_id
type: many
请注意主键:
我怀疑这与我有关。有什么想法吗?原来问题是我定义了HeadingTable::getTables和HeadingTable::getColumns。条令不喜欢这样。从另一个线程继续此操作。。。您是否运行过symfony原则:清理模型文件以删除过时的模型?这能推动事情向前发展吗?
columns:
id:
type: integer(8)
fixed: false
unsigned: false
primary: true
autoincrement: true