Ver Mensaje Individual
  #31 (permalink)  
Antiguo 20/01/2011, 22:29
Avatar de Copia
Copia
 
Fecha de Ingreso: noviembre-2009
Mensajes: 309
Antigüedad: 14 años, 5 meses
Puntos: 4
Respuesta: doctrine y codeigniter como manejar las conecciones?

Intento seguir el ejemplo, pero no logro avanzar :S.

Este es el yml que tengo en schema:
Código XML:
Ver original
  1. user:
  2.   columns:
  3.     id:
  4.       primary: true
  5.       autoincrement: true
  6.       type: integer(10)
  7.     username: string(255)
  8.     password: string(255)
  9.     firts_name: string(255)
  10.     last_name: string(255)

al aplicar $ ./doctrine generate-models-yaml se genero todo correctamente.

y este es users.yml que esta en fixtures.
Código XML:
Ver original
  1. ## YAML Template.
  2. ---
  3. User:
  4.   jwage:
  5.     username: jwage
  6.     password: test

Al ejecutar por consala optengo:
en mysql
Código BASH:
Ver original
  1. jorge@copia:/var/www/doctrine2/system/application$ ./doctrine build-all-reload
  2. build-all-reload - Are you sure you wish to drop your databases? (y/n)
  3. y
  4. build-all-reload - Successfully dropped database for connection named 'ci_doctrine'
  5. build-all-reload - Successfully created database for connection named 'ci_doctrine'
  6. build-all-reload - Created tables successfully
  7. Couldn't find class User
en postgres:
Código BASH:
Ver original
  1. jorge@copia:/var/www/doctrine2/system/application$ ./doctrine build-all-reload
  2. build-all-reload - Are you sure you wish to drop your databases? (y/n)
  3. y
  4. build-all-reload - PDO Connection Error: SQLSTATE[08006] [7] could not translate host name "postgres" to address: Name or service not known
  5. build-all-reload - PDO Connection Error: SQLSTATE[08006] [7] could not translate host name "postgres" to address: Name or service not known
  6. build-all-reload - Created tables successfully
  7. Couldn't find class User

Dejo la estructura de la base de prueba tanto en mysql y postgres:
Nombre: ci_doctrine
en mysql:
id: integer not nul autoincrement
username: varchar(255) not null
password: varchar(255) not null
first_name: varchar(255) not null
last_name: varchar(255) not null

en postgres es:
id: integer not null
username: character varying(255)
password: character varying(255)
first_name: character varying(255)
last_name: character varying(255)

Hice la prueba con ambos motores de base de datos y obtengo la misma respuesta.

Intente poniendo mi user y pass de los gestores y nada.
¿Que hago mal?
__________________
Dejando una huella de mi existencia por la red en http://tiricaya.com

Última edición por Copia; 20/01/2011 a las 22:39