Skip to content

a php written mysql workbench file reader to transform the database scheme to useful other schemes like Doctrine

License

Notifications You must be signed in to change notification settings

fgaudin/mysql-workbench-schema-exporter

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

README

ATTENTION

This software is EXPERIMENTAL and not ready for production. It is just a proof of concept.

What is MySQL Workbench schema exporter?

The application is intended to create:

  • Doctrine1
  • Doctrine2
  • Propel
  • CakePHP
  • ...

schema files from MySQL Workbench models (*.mwb). It is inspired by http://code.google.com/p/mysql-workbench-doctrine-plugin/.

Doctrine behaviours

Support for behaviours is implemented for Doctrine1. Use the comment fields in tables.

{d:actAs}
  actAs:
    timestampable:
      [..]
{/d:actAs}

Foreign key name

To replace relations name by the name of the foreign key, start the foreign key name with "d:".

Requirements

Works with PHP 5.3 and up.

Links

Example

<?php

// enable autoloading of classes
require_once('lib/MwbExporter/Core/SplClassLoader.php');
$classLoader = new SplClassLoader();
$classLoader->setIncludePath('lib');
$classLoader->register();

// define a formatter
$formatter = new \MwbExporter\Formatter\Doctrine2\Annotation\Loader();

// parse the mwb file
$mwb = new \MwbExporter\Core\Workbench\Document('myDatabaseModel.mwb', $formatter);

// show the output
echo $mwb->display();
?>

About

a php written mysql workbench file reader to transform the database scheme to useful other schemes like Doctrine

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%