Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SF4 - Doctrine migration not creating fields #367

Open
petegore opened this issue Jan 27, 2018 · 0 comments
Open

SF4 - Doctrine migration not creating fields #367

petegore opened this issue Jan 27, 2018 · 0 comments

Comments

@petegore
Copy link

petegore commented Jan 27, 2018

Hi,

I followed the doc, but while running doctrine:migration:diff Doctrine tells me that no changes have been found in the DB schema.

I'm juste trying with the timestampable biehavior.
I installed the bundle and set the following configuration :

# config/stof_doctrine_extensions.yaml
stof_doctrine_extensions:
    default_locale: fr_FR
    orm:
        default:
            timestampable: true

Is there any incompatibiity with my doctrine.yaml file that doesn't have the default part ?

# config/doctrine.yaml
doctrine:
    dbal:
        # configure these for your database server
        driver: 'pdo_mysql'
        server_version: '5.7'
        charset: utf8mb4

        # With Symfony 3.3, remove the `resolve:` prefix
        url: '%env(resolve:DATABASE_URL)%'
    orm:
        auto_generate_proxy_classes: '%kernel.debug%'
        naming_strategy: doctrine.orm.naming_strategy.underscore
        auto_mapping: true
        mappings:
            App:
                is_bundle: false
                type: annotation
                dir: '%kernel.project_dir%/src/Entity'
                prefix: 'App\Entity'
                alias: App

Thanks !

[EDIT]

I tried to update my doctrine.yaml like this, but same issue :

# config/doctrine.yaml
doctrine:    
    orm:
        auto_generate_proxy_classes: '%kernel.debug%'
        default_entity_manager: default
        entity_managers:
            default:
                naming_strategy: doctrine.orm.naming_strategy.underscore
                auto_mapping: true
                mappings:
                    App:
                        is_bundle: false
                        type: annotation
                        dir: '%kernel.project_dir%/src/Entity'
                        prefix: 'App\Entity'
                        alias: App

Am I supposed to use Gedmo annotations ?

[EDIT 2]

I added the call to Gedmo trait into my entities and it works :

use Gedmo\Timestampable\Traits\TimestampableEntity;
```

Is it the right way ? If yes, a note about it could be added at the end of the doc.
@petegore petegore changed the title SF4 - Doctrine migration not created fields SF4 - Doctrine migration not creating fields Jan 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant