English 中文(简体)
Symposiumfony Doctrine :Column Not Added to table in Database Without Executing php bin/console theory:schema:update --complete -force突击指挥部
原标题:Symfony Doctrine :Column Not Added to Table in Database Despite Executing php bin/console doctrine:schema:update --complete --force Command

Column Not Added to table in Database Without Executing php bin/console theory:schema:update --completeforce Order

指挥系统(www.chma:update-force>/index.html)的确产生有田地的实体。 然而,当我试图为现有实体增加一个领域时,它按预期做了一些工作。 尽管指挥部门成功地建立了最初的实体及其领域,但似乎在试图通过增加新的领域来修改现有实体时遇到问题。 我在为先前的实体补充领域更新该表时遇到困难。

理论

doctrine:
    dbal:
        driver: pdo_mysql
        host:  %database_host% 
        port:  %database_port% 
        dbname:  %database_name% 
        user:  %database_user% 
        password:  %database_password% 
        # only needed for MySQL
        charset: utf8mb4
        default_table_options:
            collate: utf8mb4_unicode_ci
        mapping_types:
            enum: string
        server_version: 5.7
        # Pour changer le mode sql pour supporter le NONE_FULL_GROUP_BY pour les requêtes sql
        options:
            1002:  SET sql_mode=(SELECT REPLACE(@@sql_mode, "ONLY_FULL_GROUP_BY", "")) 
        # if using pdo_sqlite as your database driver:
        #   1. add the path in parameters.yml
        #     e.g. database_path:  %kernel.project_dir%/var/data/data.sqlite 
        #   2. Uncomment database_path in parameters.yml.dist
        #   3. Uncomment next line:
        #path:  %database_path% 

    orm:    
        auto_generate_proxy_classes: false
        naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
        auto_mapping: true
        dql:
            string_functions:
                WEEK: DoctrineExtensionsQueryMysqlWeek
                MONTH: DoctrineExtensionsQueryMysqlMonth
                YEAR: DoctrineExtensionsQueryMysqlYear
            datetime_functions:
                TimestampDiff: DoctrineExtensionsQueryMysqlTimestampDiff
        mappings:
            App:
                is_bundle: false
                dir:  %kernel.project_dir%/src/Entity 
                prefix:  AppEntity 
                alias: App

when@test:
    doctrine:
        dbal:
            # "TEST_TOKEN" is typically set by ParaTest
            dbname_suffix:  _test%env(default::TEST_TOKEN)% 

when@prod:
    doctrine:
        orm:
            auto_generate_proxy_classes: false
            query_cache_driver:
                type: pool
                pool: doctrine.system_cache_pool
            result_cache_driver:
                type: pool
                pool: doctrine.result_cache_pool

    framework:
        cache:
            pools:
                doctrine.result_cache_pool:
                    adapter: cache.app
                doctrine.system_cache_pool:
                    adapter: cache.system

实体:

<?php

namespace AppEntity;

use DoctrineCommonCollectionsArrayCollection;
use DoctrineCommonCollectionsCollection;
use DoctrineDBALTypesTypes;
use DoctrineORMMapping as ORM;

/**
 * Incident_collecte
 * 
 * @author Alaa
 *
 * @ORMTable(name="incident_collecte")
 * @ORMEntity(repositoryClass="AppRepositoryIncidentCollecteRepository")
 * 
 */
class IncidentCollecte
{
 ---------   
    /**
     * @ORMColumn(type="array", nullable=true)
     * 
     * Table des meta-données d un incident qui permet sa gestion, comme son état précédent
     **/
    private $metaData;

    #[ORMColumn(type: Types::DATETIME_MUTABLE, nullable: true)]
    private ?DateTimeInterface $UpdatedDateStatutFromPortal = null;

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

    /**
     * Set dateCreation
     *
     * @param DateTime $dateCreation
     *
     * @return IncidentCollecte
     */
    public function setDateCreation($dateCreation)
    {
        $this->date_creation = $dateCreation;

        return $this;
    }

    /**
     * Get dateCreation
     *
     * @return DateTime
     */
    public function getDateCreation()
    {
        return $this->date_creation;
    }

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

        return $this;
    }

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

    /**
     * Set idDemande.
     *
     * @param int $idDemande
     *
     * @return IncidentCollecte
     */
    public function setIdDemande($idDemande)
    {
        $this->id_demande = $idDemande;

        return $this;
    }

    /**
     * Get idDemande.
     *
     * @return int
     */
    public function getIdDemande()
    {
        return $this->id_demande;
    }

    /**
     * Set dateCloture.
     *
     * @param DateTime|null $dateCloture
     *
     * @return IncidentCollecte
     */
    public function setDateCloture($dateCloture = null)
    {
        $this->date_cloture = $dateCloture;

        return $this;
    }

    /**
     * Get dateCloture.
     *
     * @return DateTime|null
     */
    public function getDateCloture()
    {
        return $this->date_cloture;
    }

    /**
     * Set typeDemande.
     *
     * @param string|null $typeDemande
     *
     * @return IncidentCollecte
     */
    public function setTypeDemande($typeDemande = null)
    {
        $this->type_demande = $typeDemande;

        return $this;
    }

    /**
     * Get typeDemande.
     *
     * @return string|null
     */
    public function getTypeDemande()
    {
        return $this->type_demande;
    }

    /**
     * Set cleDemande.
     *
     * @param string $cleDemande
     *
     * @return IncidentCollecte
     */
    public function setCleDemande($cleDemande)
    {
        $this->cle_demande = $cleDemande;

        return $this;
    }

    /**
     * Get cleDemande.
     *
     * @return string
     */
    public function getCleDemande()
    {
        return $this->cle_demande;
    }

    /**
     * Set raisonCloture.
     *
     * @param string|null $raisonCloture
     *
     * @return IncidentCollecte
     */
    public function setRaisonCloture($raisonCloture = null)
    {
        $this->raison_cloture = $raisonCloture;

        return $this;
    }

    /**
     * Get raisonCloture.
     *
     * @return string|null
     */
    public function getRaisonCloture()
    {
        return $this->raison_cloture;
    }

    /**
     * Set priorite.
     *
     * @param string $priorite
     *
     * @return IncidentCollecte
     */
    public function setPriorite($priorite)
    {
        $this->priorite = $priorite;

        return $this;
    }

    /**
     * Get priorite.
     *
     * @return string
     */
    public function getPriorite()
    {
        return $this->priorite;
    }

    /**
     * Set etat.
     *
     * @param string $etat
     *
     * @return IncidentCollecte
     */
    public function setEtat($etat)
    {
        $this->etat = $etat;

        return $this;
    }

    /**
     * Get etat.
     *
     * @return string
     */
    public function getEtat()
    {
        return $this->etat;
    }

    /**
     * Set regle.
     *
     * @param string|null $regle
     *
     * @return IncidentCollecte
     */
    public function setRegle($regle = null)
    {
        $this->regle = $regle;

        return $this;
    }

    /**
     * Get regle.
     *
     * @return string|null
     */
    public function getRegle()
    {
        return $this->regle;
    }

    /**
     * Set DatePriseEnCompteClient.
     *
     * @param DateTime|null $datePriseEnCompteClient
     *
     * @return IncidentCollecte
     */
    public function setDatePriseEnCompteClient($dateMajClient = null)
    {
        $this->date_prise_en_compte_client = $dateMajClient;

        return $this;
    }

    /**
     * Get DatePriseEnCompteClient.
     *
     * @return DateTime|null
     */
    public function getDatePriseEnCompteClient()
    {
        return $this->date_prise_en_compte_client;
    }

    /**
     * Set impact.
     *
     * @param string|null $impact
     *
     * @return IncidentCollecte
     */
    public function setImpact($impact = null)
    {
        $this->impact = $impact;

        return $this;
    }

    /**
     * Get impact.
     *
     * @return string|null
     */
    public function getImpact()
    {
        return $this->impact;
    }

    /**
     * @return Collection|Siiv[]
     */
    public function getSiiv(): Collection
    {
        return $this->siiv;
    }

    public function addSiiv(Siiv $siiv): self
    {
        if (!$this->siiv->contains($siiv)) {
            $this->siiv[] = $siiv;
        }

        return $this;
    }

    public function removeSiiv(Siiv $siiv): self
    {
        $this->siiv->removeElement($siiv);

        return $this;
    }

    /**
     * Set collecteurLogs.
     *
     * @param string|null $collecteurLogs
     *
     * @return IncidentCollecte
     */
    public function setCollecteurLogs($collecteurLogs = null)
    {
        $this->collecteur_logs = $collecteurLogs;

        return $this;
    }

    /**
     * Get collecteurLogs.
     *
     * @return string|null
     */
    public function getCollecteurLogs()
    {
        return $this->collecteur_logs;
    }

    /**
     * Set metaData.
     *
     * @param array|null $metaData
     *
     * @return IncidentCollecte
     */
    public function setMetaData($metaData = null)
    {
        $this->metaData = $metaData;

        return $this;
    }

    /**
     * Get metaData.
     *
     * @return array|null
     */
    public function getMetaData()
    {
        return $this->metaData;
    }

    /**
     * @return string|null
     */
    public function getNumoffense(): ?string
    {
        return $this->numoffense;
    }

    /**
     *
     * @param string|null $numoffense
     * @return IncidentCollecte
     */
    public function setNumoffense(?string $numoffense): IncidentCollecte
    {
        $this->numoffense = $numoffense;

        return $this;
    }

    /**
     * @return string|null
     */
    public function getSeverity(): ?string
    {
        return $this->severity;
    }

    /**
     * @param string|null $severity
     * @return IncidentCollecte
     */
    public function setSeverity(?string $severity): IncidentCollecte
    {
        $this->severity = $severity;

        return $this;
    }

    public function getUpdatedDateStatutFromPortal(): ?DateTimeInterface
    {
        return $this->UpdatedDateStatutFromPortal;
    }

    public function setUpdatedDateStatutFromPortal(?DateTimeInterface $UpdatedDateStatutFromPortal): static
    {
        $this->UpdatedDateStatutFromPortal = $UpdatedDateStatutFromPortal;

        return $this;
    }
}
问题回答

Did you try to use only annotations instead of mixing annotations and PHP attributes ?

https://stackoverflow.com/questions/66769981/how-can-i-use-php8-attributes-inoul-of-annotations-in-doctrine>。 • 如何使用第3条第1款,而不是理论中的说明?





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签