Hi i'm using Symfony and i'm trying to connect my project to a PostgreSQL server version 9.6. I'have already edited the .env file. Then i did my migrations. So I have my new tables in the database, but when i'm creating an account in my web app i have this error.
An exception occurred while executing 'SELECT t0.id AS id_1, t0.username AS username_2, t0.password AS password_3, t0.email AS email_4, t0.confirmation_token AS confirmation_token_5, t0.account_activated AS account_activated_6 FROM user t0 WHERE t0.email = ?' with params ["[email protected]"]:
SQLSTATE[42703]: Undefined column: 7 ERROR: column t0.id does not exist
LINE 1: SELECT t0.id AS id_1, t0.username AS username_2, t0.password...
I've already used
php bin/console doctrine:schema:update --force
But it changed nothing. I have also added the corrects extensions to the php.ini file.
In future, instead of changing table name, add @ORM\Table(name="user"). as shown below. Note the the grave accent ( ` ) diacritical mark.
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Security\Core\User\UserInterface;
/**
* @ORM\Entity(repositoryClass="App\Repository\UserRepository")
* @ORM\Table(name="`user`")
* @UniqueEntity(fields={"username"}, message="There is already an account with this username")
*/
class User implements UserInterface
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
.....the rest of code continues...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With