Недостающие атрибуты в базе данных - PullRequest
0 голосов
/ 10 октября 2019

когда я использую: s doctrine: schema: update --force для создания моей таблицы в моей базе данных, я получаю только атрибут id ни один из других

s doctrine: database: create s doctrine: generate:form ClubBundle: Club Я не коснулся сущности. Club.php Файл, который я использовал s doctrine: schema: update --force для создания моей таблицы, даже если в таблице есть несколько переменных, единственное, что я получаю в таблице, это только id!

<?php

namespace ClubBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

  /**
  * Club
  *
  * @ORM\Table(name="club")
  * @ORM\Entity(repositoryClass="ClubBundle\Repository\ClubRepository")
   */
  class Club
 {
/**
 * @var int
 *
 * @ORM\Column(name="id", type="integer")
 * @ORM\Id
 * @ORM\GeneratedValue(strategy="AUTO")
 */
private $id;

/**
 * @var string
 *
 * @ORM\Column(name="nom", type="string", length=255)
 */
private $nom;

/**
 * @var string
 *
 * @ORM\Column(name="description", type="string", length=255)
 */
private $description;

/**
 * @var string
 *
 * @ORM\Column(name="adresse", type="string", length=255)
 */
private $adresse;

/**
 * @var string
 *
 * @ORM\Column(name="domaine", type="string", length=255)
 */
private $domaine;


/**
 * Get id
 *
 * @return int
 */
public function getId()
{
    return $this->id;
}

/**
 * Set nom
 *
 * @param string $nom
 *
 * @return Club
 */
public function setNom($nom)
{
    $this->nom = $nom;

    return $this;
}

/**
 * Get nom
 *
 * @return string
 */
public function getNom()
{
    return $this->nom;
}

/**
 * Set description
 *
 * @param string $description
 *
 * @return Club
 */
public function setDescription($description)
{
    $this->description = $description;

    return $this;
}

/**
 * Get description
 *
 * @return string
 */
public function getDescription()
{
    return $this->description;
}

/**
 * Set adresse
 *
 * @param string $adresse
 *
 * @return Club
 */
public function setAdresse($adresse)
{
    $this->adresse = $adresse;

    return $this;
}

/**
 * Get adresse
 *
 * @return string
 */
public function getAdresse()
{
    return $this->adresse;
}

/**
 * Set domaine
 *
 * @param string $domaine
 *
 * @return Club
 */
public function setDomaine($domaine)
{
    $this->domaine = $domaine;

    return $this;
}

/**
 * Get domaine
 *
 * @return string
 */
public function getDomaine()
{
    return $this->domaine;
}

}

1 Ответ

0 голосов
/ 10 октября 2019

try

php bin/console cache:clear 

и это:

php bin/console doctrine:schema:update --complete --force

или

php bin/console doctrine:schema:update --force

, и если вы используете Symfony 4, попробуйте это

php bin/console make:migration

тогда это

php bin/console doctrine:migrations:migrate
...