Reputation: 31
I am getting familiar to Symfony-2 after having good experience with Symfony 1.4.
I was searching for a good tutorial of creating the database from a yml file (or several files), and could not find any.
Is it possible to define relations between tables and constrains in the yml file? The only documentation I found talks about metadata in the Entity file.
Upvotes: 3
Views: 3519
Reputation: 48899
Be aware: some kind of constraints will not work properly: e.g. fixed
in a column of type string is not translated as CHAR
if you use MySQL PDO, but as VARCHAR
. Also i found some undocumented constraints 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]
Upvotes: 4
Reputation: 83622
Please see the Doctrine manual... You can switch between PHP Annotations, XML and YAML for every example.
Upvotes: 1