0
更新
我現在已經回到主義的以前的版本,現在的錯誤是:錯誤教義的命令行工具
Invalid schema element named "Roles" at path "RoleResource->columns->relations"
這是白衣同YAML文件(見它下面)
我有一個教條命令行工具的問題。當我發出命令「集結所有重裝」,我得到TE以下錯誤:
SQLSTATE[42000]: Syntax error or access violation: 1072 Key column 'role_id' doesn't exist in table. Failing Query: "CREATE TABLE resource (id BIGINT AUTO_INCREMENT, name VARCHAR(20), INDEX role_id_idx (role_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = INNODB". Failing Query: CREATE TABLE resource (id BIGINT AUTO_INCREMENT, name VARCHAR(20), INDEX role_id_idx (role_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ENGINE = INNODB
我YAML文件看起來像這樣:
detect_relations: true
options:
type: INNODB
collate: utf8_general_ci
charset: utf8
Log:
columns:
id:
type: integer
primary: true
autoincrement: true
priority: tinyint
priorityName: string(10)
title: string(250)
message: text
actAs:
Timestampable:
created:
type: timestamp
format: Y-m-d H:i:s
updated:
disabled: true
User:
columns:
id:
type: integer
primary: true
autoincrement: true
username: string(50)
password: string(40)
actAs:
Timestampable:
created:
type: timestamp
format: Y-m-d H:i:s
updated:
type: timestamp
format: Y-m-d H:i:s
Role:
columns:
id:
type: integer
primary: true
autoincrement: true
name: string(20)
attributes:
export: all
validate: true
RoleResource:
columns:
role_id:
type: integer
primary: true
resource_id:
type: integer
primary: true
relations:
Role:
foreignAlias: RoleResource
Resource:
foreignAlias: RoleResource
Resource:
columns:
id:
type: integer
primary: true
autoincrement: true
name: string(20)
relations:
Roles:
foreignAlias: Resources
class: Role
refClass: RoleResource
Menu:
columns:
id:
type: integer
primary: true
autoincrement: true
label: string(20)
Artical:
columns:
id:
type: integer
primary: true
autoincrement: true
title: string
content: longtext
css: longtext
js: longtext
我不知道如何解決這個問題。
有人可以幫我嗎?
它似乎試圖在資源表中的role_id列上添加索引,但該表不包含此列。您是否確定這是您的構建命令正在執行的模式文件? – Tom 2010-11-26 00:44:02
我確定,但它看起來像教條緩存文件。 – 2010-11-26 10:00:02