Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 2.0-BETA1
-
Fix Version/s: 2.0-BETA3
-
Component/s: Mapping Drivers
-
Security Level: All
-
Labels:None
Description
The string lenght specified in the Yaml file is not respected on id columns.
Sample YAML file
---
# Entities.Stock.dcm.yml
Entities\Stock:
type: entity
table: stocks
id:
id:
type: string
length: 10
generator:
strategy: NONE
fields:
nature:
type: string
length: 10
name:
type: string
length: 40
creationDate:
name: creation_date
type: datetime
owner:
type: string
length: 8
Command used to generate the SQL statements:
./doctrine orm:schema-tool:create --dump-sql
Result:
CREATE TABLE stocks (id VARCHAR(255) NOT NULL, nature VARCHAR(12) NOT NULL, name VARCHAR(40) NOT NULL, creationDate DATETIME NOT NULL, owner VARCHAR(8) NOT NULL, PRIMARY KEY(id)) ENGINE = InnoDB
The "id" is generated as VARCHAR(255) instead of VARCHAR(10).
Fixed formating