Foros del Web » Programando para Internet » PHP » Symfony »

[SOLUCIONADO] Problema Doctrine - Symfony

Estas en el tema de Problema Doctrine - Symfony en el foro de Symfony en Foros del Web. Cordial saludo. Estoy empezando a trabajar con Symfony.. me cree una Entidad y al crearla en la Base de Datos con doctryne me genera el ...
  #1 (permalink)  
Antiguo 27/01/2014, 15:28
Avatar de lucho2000  
Fecha de Ingreso: mayo-2012
Mensajes: 38
Antigüedad: 11 años, 10 meses
Puntos: 0
Sonrisa Problema Doctrine - Symfony

Cordial saludo.

Estoy empezando a trabajar con Symfony.. me cree una Entidad y al crearla en la Base de Datos con doctryne me genera el siguiente error:

[root@localhost Symfony]# php app/console doctrine:schema:create
ATTENTION: This operation should not be executed in a production environment.

Creating database schema...

[Doctrine\DBAL\DBALException]
Unknown column type "numeric" requested. Any Doctrine type that you use has to be registered with \Doctrine\DBAL\Types\Type::addType(). You can get a list of all
the known types with \Doctrine\DBAL\Types\Type::getTypesMap(). If this error occurs during database introspection then you might have forgot to register all database types for a Doctrine Type. Use AbstractPlatform#registerDoctrineTypeMapping() or have your custom types implement Type#getMappedDatabaseTypes(). If the type n
ame is empty you might have a problem with the cache or forgot some mapping information.



doctrine:schema:create [--dump-sql] [--em[="..."]]



Como lo puedo solucionar ?

Gracias
__________________
LuisPuentes
  #2 (permalink)  
Antiguo 27/01/2014, 16:49
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 11 meses
Puntos: 2135
Respuesta: Problema Doctrine - Symfony

Pues si el tipo de campo que quieres es número, no debes de poner "numeric", si no "integer"...
  #3 (permalink)  
Antiguo 27/01/2014, 16:53
Avatar de lucho2000  
Fecha de Ingreso: mayo-2012
Mensajes: 38
Antigüedad: 11 años, 10 meses
Puntos: 0
Respuesta: Problema Doctrine - Symfony

Estoy usando como BAse de datos Postgresql, y postgresq acepta el campo de tipo numerico..
__________________
LuisPuentes
  #4 (permalink)  
Antiguo 27/01/2014, 17:28
Avatar de GatorV
$this->role('moderador');
 
Fecha de Ingreso: mayo-2006
Ubicación: /home/ams/
Mensajes: 38.567
Antigüedad: 17 años, 11 meses
Puntos: 2135
Respuesta: Problema Doctrine - Symfony

Así es pero en Doctrine el tipo de campo se llama "integer" no "numeric".
  #5 (permalink)  
Antiguo 27/01/2014, 17:28
Avatar de masterpuppet
Software Craftsman
 
Fecha de Ingreso: enero-2008
Ubicación: Montevideo, Uruguay
Mensajes: 3.550
Antigüedad: 16 años, 3 meses
Puntos: 845
Respuesta: Problema Doctrine - Symfony

Que un vendor tenga determinado tipo de dato no quiere decir que doctrine lo soporte, de todas formas, para tu caso, el numeric de postgres mapea a decimal en doctrine.

Saludos.
__________________
http://es.phptherightway.com/
thats us riders :)
  #6 (permalink)  
Antiguo 27/01/2014, 17:31
Avatar de lucho2000  
Fecha de Ingreso: mayo-2012
Mensajes: 38
Antigüedad: 11 años, 10 meses
Puntos: 0
De acuerdo Respuesta: Problema Doctrine - Symfony

Ok... muchisimas gracias..
__________________
LuisPuentes
  #7 (permalink)  
Antiguo 27/01/2014, 19:02
Avatar de hhs
hhs
Colaborador
 
Fecha de Ingreso: junio-2013
Ubicación: México
Mensajes: 2.995
Antigüedad: 10 años, 9 meses
Puntos: 379
Respuesta: Problema Doctrine - Symfony

Cita:
Iniciado por lucho2000 Ver Mensaje
Cordial saludo.

Estoy empezando a trabajar con Symfony.. me cree una Entidad y al crearla en la Base de Datos con doctryne me genera el siguiente error:

[root@localhost Symfony]# php app/console doctrine:schema:create
ATTENTION: This operation should not be executed in a production environment.

Creating database schema...

[Doctrine\DBAL\DBALException]
Unknown column type "numeric" requested. Any Doctrine type that you use has to be registered with \Doctrine\DBAL\Types\Type::addType(). You can get a list of all
the known types with \Doctrine\DBAL\Types\Type::getTypesMap(). If this error occurs during database introspection then you might have forgot to register all database types for a Doctrine Type. Use AbstractPlatform#registerDoctrineTypeMapping() or have your custom types implement Type#getMappedDatabaseTypes(). If the type n
ame is empty you might have a problem with the cache or forgot some mapping information.



doctrine:schema:create [--dump-sql] [--em[="..."]]



Como lo puedo solucionar ?

Gracias
Si lo consideras necesario puedes extender los tipos de datos que soporta Doctrine. Leer
http://docs.doctrine-project.org/pro...-mapping-types
http://symfony.com/doc/current/cookb...-mapping-types

Pero para tu caso particular creo que la solucion de MasterPuppet es la indicada
__________________
Saludos
About me
Laraveles
A class should have only one reason to change.

Etiquetas: doctrine
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 05:41.