Witam,
PRobuje utworzyc tabele z powiazaniem wiele do wielu.
Mam problem w czasie tworzenia modelu komenda ' symfony propel-build-model'. Po utworzeniu tabeli 'gallery_author' dostaje blad:
<?php
propel > om-template:
[propel
-om
] Target database type
: mysql [propel-om] Target package: lib.model
[propel-om] Using template path: /usr/share/php/symfony/vendor/propel-generator/templates
[propel-om] Output directory: /www/symfony/company
[propel-om] Processing: schema.xml
Execution of target
"om-template" failed
for the following reason
: /usr
/share
/php
/symfony
/vendor
/propel
-generator
/build
-propel
.xml
:470
:1
: ERROR
!! Attempt to set foreign
key to nonexistent column
, id
, in table
, author
![phingcall
] /usr
/share
/php
/symfony
/vendor
/propel
-generator
/build
-propel
.xml
:470
:1
: ERROR
!! Attempt to set foreign
key to nonexistent column
, id
, in table
, author
! ?>
Plik schema.xml:
<?xml version="1.0" encoding="UTF-8"?>
<database name="propel" noXsd="true" defaultIdMethod="none" package="lib.model">
<table name="author">
<column name="author_id" type="integer" required="true" primaryKey="true" autoIncrement="true" />
<column name="author_firstname" type="varchar" size="30" required="true" />
<column name="author_lastname" type="varchar" size="30" required="true" />
<column name="author_telephone" type="varchar" size="15" />
<column name="author_email" type="varchar" size="30" />
<column name="author_status" type="boolean" required="true" default="1" />
<column name="updated_at" type="timestamp" />
<column name="created_at" type="timestamp" />
</table>
<table name="gallery">
<column name="gallery_id" type="integer" required="true" primaryKey="true" autoIncrement="true" />
<column name="gallery_name" type="varchar" size="100" required="true" />
<column name="gallery_desc" type="varchar" size="255" />
<column name="gallery_img" type="varchar" size="50" />
<column name="gallery_status" type="boolean" required="true" default="1" />
<column name="updated_at" type="timestamp" />
<column name="created_at" type="timestamp" />
</table>
<table name="gallery_author">
<column name="gallery_author_id" type="integer" required="true" primaryKey="true" autoIncrement="true" />
<column name="author_id" type="integer" />
<foreign-key foreignTable="author">
<reference local="author_id" foreign="id"/>
</foreign-key>
<column name="gallery_id" type="integer" />
<foreign-key foreignTable="gallery">
<reference local="gallery_id" foreign="id"/>
</foreign-key>
</table>
</database>