Details
-
Type:
Bug
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 1.2.2
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
Environment:LAMP, PHP 5.2.6, PostgreSQL 8.3
Description
We have the following YAML:
Yaml
User:
columns:
id:
type: integer
unsigned: 1
primary: true
autoincrement: true
username:
type: string(255)
notnull: true
indexes:
username_index:
fields:
username:
type: unique
The resulting record-class looks like this, which is still fine:
Class
class User extends Doctrine_Record { public function setTableDefinition() { $this->setTableName('users'); $this->hasColumn('id', 'integer', null, array( 'type' => 'integer', 'unsigned' => 1, 'primary' => true, 'autoincrement' => true, )); $this->hasColumn('username', 'string', 255, array( 'type' => 'string', 'notnull' => true, 'length' => '255', )); $this->index('username_index', array( 'fields' => array( 'username' => array( 'type' => 'unique', ), ), )); } public function setUp() { parent::setUp(); } }
But the resulting SQL looks like this, which is faulty because of the Array stuff at the index:
SQL
CREATE TABLE "users" ("id" BIGSERIAL, "username" VARCHAR(255) NOT NULL, PRIMARY KEY("id")); CREATE INDEX "username_index" ON "users" ("Array");