故障かなと思ったら"キー列には存在しないテーブル"がビルからスキーマ.yml
質問
私は、以下のスキーマ.ymlファイル:
Page:
actAs:
I18n:
fields: [name,html,urlShortDesc]
columns:
name: string
gender:
type: enum
values: [html, photoGallery]
default: html
html: string
urlShortDesc: string
section_id:
type: integer
notnull: true
relations:
Section:
foreignAlias: Pages
SubPage:
class: Page
local: subpage
foreign: id
type: one
でも、私が実行さ build-all-reload
コマンドを実行すると、以下のようなエラーメッセージが表示された:
SQLSTATE[42000]:構文エラーまたはアクセス違反:1072Keyカラムは'subpage'は存在しないテーブル
ようにしていを実施する自己に関す。
解決
たいと思いますいそのまま表示されて
SubPage:
class: Page
local: subpage
foreign: id
type: one
が必要なidカラム(海外:id)の主キーのページにテーブル、カラムと呼ばれるsubpage'を含む参考現地:subpage)の子供です。いページid="100"を含むを販売するとコミットされているsubpage載したid="200"が"200"は、実際にkey(id)のページです。
更新:からのコメントを修正原スキーマファイル:
Page:
actAs:
I18n:
fields: [name,html,urlShortDesc]
columns:
name: string
gender:
type: enum
values: [html, photoGallery]
default: html
html: string
urlShortDesc: string
section_id:
type: integer
notnull: true
id:
type: integer
notnull: true
subpage:
type: integer
notnull: false
relations:
Section:
foreignAlias: Pages
SubPage:
class: Page
local: subpage
foreign: id
type: one
ごを作っていいくつかの深刻な前提をおススキーマを含む:
- したいidとして次のことになるまで設定されている(autoincrement:真のスキーマ).
- subpageはオプションとして子関係
- section_idおこない現代的な内装に変わ主キー
所属していません StackOverflow