mam istniejąca już bazę danych, więc za pomocą skryptu doctrine robie import tabel. I teraz mam pytanie czy doctrine ustaliło mi relacje, klucze obce między tabelami czy sam musze to zrobić?
Bo jak zaglądam w wygenerowany kod to tam jest coś takiego:
<?php
abstract class BaseFile extends Doctrine_Record
{
public function setTableDefinition()
{
$this->setTableName('file');
$this->hasColumn('id', 'integer', 4
, array('alltypes' => array( 0 => 'integer', ), 'ntype' => 'int(10) unsigned', 'unsigned' => 1, 'values' => array(), 'primary' => true, 'notnull' => true, 'autoincrement' => true)); $this->hasColumn('name', 'string', 150
, array('alltypes' => array( 0 => 'string', ), 'ntype' => 'varchar(150)', 'fixed' => false, 'values' => array(), 'primary' => false, 'notnull' => false, 'autoincrement' => false)); $this->hasColumn('size', 'integer', 8
, array('alltypes' => array( 0 => 'integer', ), 'ntype' => 'bigint(20)', 'unsigned' => 0, 'values' => array(), 'primary' => false, 'notnull' => false, 'autoincrement' => false)); $this->hasColumn('modified', 'integer', 8
, array('alltypes' => array( 0 => 'integer', ), 'ntype' => 'bigint(20)', 'unsigned' => 0, 'values' => array(), 'primary' => false, 'notnull' => false, 'autoincrement' => false)); $this->hasColumn('type', 'string', 10
, array('alltypes' => array( 0 => 'string', ), 'ntype' => 'varchar(10)', 'fixed' => false, 'values' => array(), 'primary' => false, 'notnull' => false, 'autoincrement' => false)); $this->hasColumn('content', 'string', null, array('alltypes' => array( 0 => 'string', 1 => 'clob', ), 'ntype' => 'text', 'fixed' => false, 'values' => array(), 'primary' => false, 'notnull' => false, 'autoincrement' => false)); $this->hasColumn('path', 'string', null, array('alltypes' => array( 0 => 'string', 1 => 'clob', ), 'ntype' => 'text', 'fixed' => false, 'values' => array(), 'primary' => false, 'notnull' => false, 'autoincrement' => false)); }
public function setUp()
{
parent::setUp();
}
?>
nie ma natomiast w setUp() ustalonych relacji, kluczy obcych??