logo
Ask your Symfony questions! Pay money and get answers fast! (more info)

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.

$4
examples of listing 2 databases in one schema.yml file

Can someone please post an example of listing 2 databases in one schema.yml? Thanks much. I'm looking for the right syntaxt/indentation.

This question has been answered.

Lawrence Krubner | 05/12/10 at 12:03pm Edit


(2) Responses

See a threaded view of answers?

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

  • avatar
    Last edited:
    05/12/10
    12:26pm
    Arturo Linares says:

    This databases.yml has 2 postgres connections

    databases.yml


    all:
    propel:
    class: sfPropelDatabase
    param:
    dsn: pgsql://user:secret@server/dbname
    extra:
    class: sfPropelDatabase
    param:
    dsn: pgsql://another_user:another_secret@server/extra_db
    encoding: utf8 # Default charset for table creation
    persistent: false # Use persistent connections



    In the schema, the parent of your tables should be the name of the connection.

    schema.yml

    # this is for the first database
    propel:
    customer:
    id:
    name: varchar
    last_name: varchar

    # this is for another database
    extra:
    account:
    id:
    username: varchar
    created_at

  • avatar
    Last edited:
    05/12/10
    12:26pm
    michalg says:

    databases.yml


    database1:
    class: sfDoctrineDatabase
    param:
    dsn: pgsql:host=localhost;dbname=database1
    username: michal
    password:

    database2:
    class: sfDoctrineDatabase
    param:
    dsn: pgsql:host=localhost;dbname=database2
    username: michal
    password:


    schema.yml

    Test1:
    connection: database1
    columns:
    number: { type: string(30), notnull: true }

    Test2:
    connection: database2
    columns:
    number: { type: string(30), notnull: true }

This question has expired.





Current status of this question: Completed



Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.