Symfony 2 and database structure with yml

I am familiar with Symfony-2 after a good experience with Symfony 1.4.

I was looking for a good guide on creating a database from a yml file (or multiple files) and could not find.

Is it possible to define relationships between tables and constraints in a yml file? The only documentation I found talks about metadata in an Entity file.

+4
source share
2 answers

Know: some restrictions will not work properly: for example. fixed in a column of a type string does not translate as CHAR if you use MySQL PDO, but as VARCHAR . I also found some undocumented restrictions for YALM:

Unique index

 MyCompany\MyApp\MyClass: type: entity table: myclass uniqueConstraints: UNIQ_NAME: columns: [column1, column2] 

General index :

 MyCompany\MyApp\MyClass: type: entity table: myclass indexes: IDX_NAME: columns: [column1, column2] 
+4
source

See the Doctrine tutorial ... You can switch between PHP, XML, and YAML annotations for each example.

+1
source

All Articles