smClayToDoctrineSchemaPlugin - 0.0.3

Transforms a clay model (model.clay) into a doctrine schema.yml

You are currently browsing
the website for symfony 1

Visit the Symfony2 website


« Back to the Plugins Home

Signin


Forgot your password?
Create an account

Tools

Stats

advanced search
Information Readme Releases Changelog Contribute
Show source

smClayToDoctrineSchemaPlugin

This is a highly experimental release that will convert a clay model into a doctrine schema. I am expanding this plugin as required, and will post updates as they are available.

This plugin is based on the sfDbDesignerPlugin and was inspired by the post by al_n on the forums.

note: I have only been working with INNODB tables in a mysql database. Some of the data-types are probably not implemented yet

Working

  • Creation of tables
  • Creation of relationships
  • Creation of 1:1 relationships
  • Addition of 'global options' via 'Begin Script' section of clay
  • Using 'foreignAlias' for relations

TODO

  • Fix indexes and unique keys
  • ?

Creating a 1:1 relationship

I am relatively new to doctrine, so some of these processes may be incorrect.

  1. Create a parent and a slave table. In the slave table, add a foreign key in the normal fashion (It seems Doctrine fails when using straight ID<->ID links).

  2. (Optional) Add the 'foreignAlias' in the 'Logical Name' section of the relationship properties

Adding global options to the schema.yml

Often, you may wish to set the character set and collation for all of your tables. To do this, we can utilise the 'begin script' section of the model.

  1. Right click the canvas area and click 'Edit Database Model'. Choose 'Begin Script'.

  2. Paste the following:

    options: type: INNODB charset: utf8 collate: utf8_unicode_ci