【发布时间】:2011-03-09 08:43:30
【问题描述】:
下面是我的 schema.yml
CmsFooter:
actAs:
I18n:
fields: [title,description]
Timestampable:
columns:
id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: true
is_default:
type: enum(1)
values: [Y, N]
default: N
notnull: true
autoincrement: false
title:
type: string(255)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
description:
type: string()
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
LanguageMaster:
actAs:
Timestampable:
columns:
id:
type: integer(11)
fixed: false
unsigned: false
primary: true
autoincrement: true
name:
type: string(50)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
culture:
type: string(4)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
is_active:
type: enum(1)
fixed: false
unsigned: false
values:
- Y
- N
primary: false
default: N
notnull: true
autoincrement: false
is_default:
type: enum(1)
fixed: false
unsigned: false
values:
- Y
- N
primary: false
default: N
notnull: true
autoincrement: false
file_name:
type: string(50)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
relations:
CmsFooterTranslation:
local: culture
foreign: lang
type: many
onDelete: CASCADE
onUpdate: CASCADE
我正在生成架构 -> 数据库。
当我运行这个架构时,它没有在数据库表中提供关系
表名:- cms_footer_translation 字段:- 语言
在关系中我需要它应该显示 language_master.culture ondelete cascade & onupdate cascade
有什么帮助吗??
【问题讨论】:
-
提示:定义布尔值时(如您的情况下的
is_default),只需使用:is_default: {type: boolean, notnull: true, default: 0}。它可以为您节省大量工作。 Detailed explanation here -
您能澄清一下您要完成哪些表之间的关系吗?我真的无法从你的问题中解脱出来。
标签: symfony1 doctrine symfony-1.4