SQLite3 / PDO - No such table though it does exist

后端 未结 2 1287
野性不改
野性不改 2021-01-18 19:11

I have a problem with an SQLite3 database where I can access it either with the sqlite3 command or with the PHPStorm built-in database manager but the application I am worki

相关标签:
2条回答
  • 2021-01-18 19:22

    The database that you have opened does not contain this table.

    SQLite will happily open any file name; if it does not exist, it will create a new, empty database.

    Check your database file name.

    0 讨论(0)
  • 2021-01-18 19:45

    Thanks to the accepted answer that pointed me in the right direction. I am using Symfony 4.1 and realized that the base directory for Symfony is the public directory (should be app in 2.8) so to open my database I had to do :

    # file: PROJECT_ROOT/.env
    DATABASE_URL="sqlite:///../my_super.db"
    

    But then, every call to doctrine in a command (like doctrine:schema:update) must be called in a direct subfolder of the project, like so:

    PROJECT_ROOT/bin$ ./console doctrine:schema:update --dump-sql

    0 讨论(0)
提交回复
热议问题