0
私のしていることは、私のUser
テーブルと私のConfirmation
テーブルとの弱い関係であり、User
の弱い関係です。それを表現するために、私のスキーマは次のとおりです。doctrineとsymfonyを使用して弱い関係を作る
SQLSTATE[42000]: Syntax error or access violation: 1072 Key column 'id' doesn't exist in table. Failing Query: "CREATE TABLE Confirmation (user_id BIGINT, hash VARCHAR(64) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX id_idx (id), PRIMARY KEY(user_id)) ENGINE = INNODB". Failing Query: CREATE TABLE Confirmation (user_id BIGINT, hash VARCHAR(64) NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX id_idx (id), PRIMARY KEY(user_id)) ENGINE = INNODB
ので、それは教義がフィールド上のインデックスを生成しているようだ:
User:
actAs: [Timestampable]
connection: doctrine
tableName: User
columns:
id:
type: integer
primary: true
autoincrement: true
username:
type: string(50)
notnull: true
name:
type: string(50)
notnull: true
.
.
.
indexes:
myindex1:
fields:
username:
sorting: ASC
length: 50
type: unique
relations:
Confirmation:
foreignType: one
attributes:
export: all
validate: true
Confirmation:
actAs: [Timestampable]
connection: doctrine
tableName: Confirmation
columns:
user_id:
type: integer
primary: true
hash:
type: string(64)
notnull: true
relations:
User:
local: user_id
foreign: id
type: one
foreignType: one
コマンド
$ php symfony doctrine:build --all --no-confirmation
を実行しているとき、私は出力にこのエラーを得ましたそれは
INDEX id_idx (id)
のように定義されていませんでした(
id
)。なぜドクトリンはこのインデックスを生成していますか?どのように私は私が欲しいものをモデル化できますか?
教義のマニュアルには...良いドキュメントサイトへのリンクが非常にあまりにも高く評価されるだろう、関係の問題で任意の助けを事前に
おかげで非常に広範囲ではありません!