Stephen's dev blog

Archive for March 2009

  • In: Tutorials
  • Comments Off on Symfony “Database “” does not exist.” error

Hello,

It’s definitely been too long since I posted here! I will try and post more regularly over the coming months…

Firstly, we came across this issue after writing a number of plugins for a symfony project. Each of these plugins had their own schema.yml files and therefore we didn’t need our own custom schema.yml file at that time.

Because of this, our config/schema.yml file looked like this:

    propel:

Pretty, right? When we ran symfony propel:build-sql (after the other usual build tasks) we got the error:

    Database "" does not exist.

In symfony’s glorious vibrant red error container. It seems when your schema file looks like ours did above, symfony generates the sqldb.map file for that file without a database name, our data/sql/sqldb.map file looked similar to this:


    # Sqlfile -> Database map
    ...
    lib.model.schema.sql=propel
    plugins.pluginName.lib.model.schema.sql=propel
    plugins.pluginName2.lib.model.schema.sql=propel
    generated-schema.sql=propel
    generated-pluginName-schema.sql=propel
    generated-pluginName2-schema.sql=propel
    ...

The quick fix, especially if you don’t want to have to add a custom table in your schema just to get round this, is to simple add ‘propel’ onto the end of the line that is missing it.

Hopefully there’s a proper fix that I so far haven’t been bothered to find…



  • Patrick: I changed my code, but now I have another problem: Fatal error: Call to a member function isAvailable() on a non-object in /var/www/vhost/web/shopA
  • Stephen Gray: Hi Patrick, That first error is my fault. I had the method name for the refund() method as void() as I had copied the code from the other method!
  • Patrick: Hi Stephen, thanks for sharing your knowledge about creating a custom payment module. I need an extension for magento to handle a credit card payme

Categories