Taylor Beear
Taylor Beear

Reputation: 93

How to generate entities and update database schema in Silex

I use doctrine ORM

I create entity without console. It looks like

Trololo\Event:
  type: entity
  table: events
  readOnly: false
  id:
    id:
      type: guid
      generator:
      strategy: UUID
 fields:
    dateCreated:
       type: datetime
       nullable: false
    name:
       type: string
       length: 75
    startDate:
       type: datetime
       nullable: false

How can I tell doctrine, for this filed? I need create database, now I need create table.

Upvotes: 2

Views: 2385

Answers (1)

JF Dion
JF Dion

Reputation: 4054

By default, Silex support only the DBALpackage of Doctrine for database. If you want to use the ORMpackage and have it integrated in your application, you would have to use a ServiceProvider

List of a few services providers for Silex

To use the command line for building your database/schema, you will have to use doctrine command lines from the library itself (it's not wrapped in console as it is in Symfony)

Here is the list of Doctrine's commands

Upvotes: 2

Related Questions