2
votes

I'm using codeigniter with Doctrine 2 with CodeIgniter2. I used YAML Schema files to define database schema. I want to define two columns in my table with MySQL data-type Double. Below is the YAML Mapping I tried

Entities\Location:
  type: entity
  table: locations
  fields:
    id:
      type: integer
      id: true
      generator:
        strategy: AUTO
    Name:
      type: string
      length: 40
      nullable: false
    longitude:
      type: double
    latitude:
      type: double

But the code throws error when I try to create Models from YAML.

Entities were created successfully.

The Error Messages are:

Class double does not exist while trying to create proxies

and

Unknown column type double requested while trying to create schema

1

1 Answers

2
votes

In 1.2 I think it was 'float' or 'decimal'. Try one of those.

Here's a reference to the 1.2 docs... I'm struggling to find the 2.x docs that say the same thing.

http://www.doctrine-project.org/projects/orm/1.2/docs/manual/defining-models/pl