IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Doctrine2 PHP Discussion :

pb maj tables


Sujet :

Doctrine2 PHP

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Inscrit en
    Mars 2007
    Messages
    78
    Détails du profil
    Informations forums :
    Inscription : Mars 2007
    Messages : 78
    Par défaut pb maj tables
    bonjour,

    Je rencontre un message du genre :

    Rien à maj - votre base est deja synchronisee avec les metadatas des entites...

    qd je lance la cmde php app/console doctrine:schema:update --force

    voici mes entitées :

    Rubrique
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
     
    namespace Msm\SiteBundle\Entity;
     
    use Doctrine\ORM\Mapping as ORM;
     
    /**
     * Msm\SiteBundle\Entity\Rubrique
     * 
     * @ORM\Table()
     * @ORM\Entity(repositoryClass="Msm\SiteBundle\Entity\RubriqueRepository")
     */
    class Rubrique {
        /**
         * 
         * @var smallint $idrubrique
         * @ORM\Column(name="idrubrique", type="smallint")
         * @ORM\Id
         * @ORM\GeneratedValue(strategy="AUTO")
         */
        private $idrubrique;
     
        /**
         * 
         * @var smallint $idcategorie
         * @ORM\Column(name="idcategorie", type="smallint")
         * @ORM\ManyToOne(targetEntity="Categorie")
         * @ORM\JoinColumn(name="idcategorie", referencedColumnName="idcategorie")
         */
        private $idcategorie;
     
        /**
         * 
         * @var string $nomrubrique
         * @ORM\Column(name="nomrubrique", type="string", length=255)
         */
        private $nomrubrique;
     
        /**
         * Set idrubrique
         *
         * @param smallint $idrubrique 
         */
        public function setIdrubrique($idrubrique)
        {
            $this->idrubrique = $idrubrique;
        }
     
        /**
         * Get idrubrique
         * 
         * @return smallint 
         */
        public function getIdrubrique()
        {
            return $this->idrubrique;
        }
     
        /**
         * Set idcategorie
         *
         * @param smallint $idcategorie 
         */
        public function setIdcategorie($idcategorie)
        {
            $this->idcategorie = $idcategorie;
        }
     
        /**
         * Get idcategorie
         * 
         * @return smallint 
         */
        public function getIdcategorie()
        {
            return $this->idcategorie;
        }
     
        /**
         * Set nomrubrique
         * 
         * @param string $nomrubrique 
         */
        public function setNomrubrique($nomrubrique)
        {
            $this->nomrubrique = $nomrubrique;
        }
     
        /**
         * Get nomrubrique
         * 
         * @return string 
         */
        public function getNomrubrique()
        {
            return $this->nomrubrique;
        }
    }
    et Categorie
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
     
     
     
    namespace Msm\SiteBundle\Entity;
     
    use Doctrine\ORM\Mapping as ORM;
     
    /**
     * Msm\SiteBundle\Entity\Categorie
     * 
     * @ORM\Table()
     * @ORM\Entity(repositoryClass="Msm\SiteBundle\Entity\CategorieRepository")
     */
    class Categorie {
        /**
         * 
         * @var smallint $idcategorie
         * @ORM\Column(name="idcategorie", type="smallint")
         * @ORM\Id
         * @ORM\GeneratedValue(strategy="AUTO")
         */
        private $idcategorie;
     
        /**
         * 
         * @var string $nomcategorie
         * @ORM\Column(name="nomcategorie", type="string", length=255)
         */
        private $nomcategorie;
     
        /**
         * Set idcategorie
         *
         * @param smallint $idcategorie
         */
        public function setIdcategorie($idcategorie)
        {
            $this->idcategorie = $idcategorie;
        }
     
        /**
         * Get idcategorie
         * 
         * @return smallint 
         */
        public function getIdcategorie()
        {
            return $this->idcategorie;
        }
     
        /**
         * Set nomcategorie
         * 
         * @param string $nomcategorie 
         */
        public function setNomcategorie($nomcategorie)
        {
            $this->nomcategorie = $nomcategorie;
        }
     
        /**
         * Get nomcategorie
         * 
         * @return string 
         */
        public function getNomcategorie()
        {
            return $this->nomcategorie;
        }
    }
    J'essaie juste d'ajouter une cle etrangere idcategorie à la table Rubrique. Merci pour votre aide.

  2. #2
    Membre confirmé
    Inscrit en
    Mars 2007
    Messages
    78
    Détails du profil
    Informations forums :
    Inscription : Mars 2007
    Messages : 78
    Par défaut
    bon j'ai trouvé l'erreur. qqs lignes en trop.

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. MAJ table Sqlite
    Par Ggamer dans le forum Général Python
    Réponses: 2
    Dernier message: 29/04/2008, 17h45
  2. MAJ table avec fonction
    Par aechevar dans le forum Oracle
    Réponses: 7
    Dernier message: 06/12/2006, 17h30
  3. [Débutant] Imortation données (maj) table à table
    Par tikam dans le forum MS SQL Server
    Réponses: 3
    Dernier message: 25/10/2006, 14h12
  4. MAJ table Ref a partir d'une table temporaire
    Par juan64 dans le forum MS SQL Server
    Réponses: 1
    Dernier message: 28/08/2006, 15h06
  5. [9iR2] UPDATE pour MAJ table ds 1 autre identique...
    Par mainecoon dans le forum Oracle
    Réponses: 8
    Dernier message: 15/02/2006, 20h33

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo