首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >您能生成与Symfony (使用原则)的关系吗?

您能生成与Symfony (使用原则)的关系吗?
EN

Stack Overflow用户
提问于 2011-03-02 17:07:37
回答 1查看 239关注 0票数 0

目前,如果我执行以下操作,它只生成schema.yml:

./symfony理论:构建模式

但这并不能产生这种关系。

我需要手动将它们添加到schema.yml中吗?还是有一种方法来生成它们?如果我必须手动输入它,那么下次我执行doctrine:build-schema (用新表刷新模式等)时,它们不会被重写吗?

下面是schema.yml:

代码语言:javascript
复制
Companies:
  connection: doctrine
  tableName: companies
  columns:
    company_id:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: true
      autoincrement: true
    company_name:
      type: string(100)
      fixed: false
          unsigned: false
      primary: false
      notnull: true
      autoincrement: false
    company_logo:
      type: string(100)
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
    company_date_added:
      type: timestamp(25)
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
Credentials:
  connection: doctrine
  tableName: credentials
  columns:
    credential_id:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: true
      autoincrement: true
    credential_name:
      type: string(100)
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
    company_id:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
    credential_date_added:
      type: timestamp(25)
      fixed: false
      unsigned: false
      primary: false
      default: '0000-00-00 00:00:00'
      notnull: true
      autoincrement: false
Groups:
  connection: doctrine
  tableName: groups
  columns:
    group_id:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: true
      autoincrement: true
    group_name:
      type: string(100)
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
    company_id:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
    group_date_added:
      type: timestamp(25)
      fixed: false
      unsigned: false
      primary: false
      default: '0000-00-00 00:00:00'
      notnull: true
      autoincrement: false
GroupsCredentials:
  connection: doctrine
  tableName: groups_credentials
  columns:
    group_credential_id:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: true
      autoincrement: true
    group_id:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
    credential_id:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
    group_credential_date_added:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
Users:
  connection: doctrine
  tableName: users
  columns:
    user_id:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: true
      autoincrement: true
    user_username:
      type: string(100)
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
    user_password:
      type: string(100)
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
    user_email:
      type: string(100)
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
    company_id:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
    user_date_added:
      type: timestamp(25)
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
UsersCredentials:
  connection: doctrine
  tableName: users_credentials
  columns:
    user_credential_id:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: true
      autoincrement: true
    user_id:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
    credential_id:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: false
      notnull: true
      autoincrement: false
    user_credential_date_added:
      type: timestamp(25)
      fixed: false
      unsigned: false
      primary: false
      default: '0000-00-00 00:00:00'
      notnull: true
      autoincrement: false
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-03-02 21:49:58

我最终解决了这个问题。

这些关系没有在MySQL数据库中正确地建立--我犯了一个愚蠢的错误。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5170878

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档