News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Sameer Borate' Blog:
Creating SQL schemas with Doctrine DBAL
December 22, 2010 @ 14:25:53

On his blog today Sameer Borate has a new post looking at using Doctrine DBAL to make schemas rather than having to make them by hand each time (can be very useful for reloads with fixtures).

A tedious task during web development is that of database schema creation. A schema containing a few tables comprising of a small set of rows is quick, while that containing dozens of tables and large numbers of columns is a tedious process. I usually resort to a small php script with some regular expression tossed in to automatically create a schema from a text file definition. But that is a little buggy as I've to manually add the indexes and other small things. Now that Doctrine has released a DBAL library, this will provide a nice ability to automatically create sql schemas.

He introduces the DBAL abstraction layer and includes a basic script to create a schema for a MySQL database, manually adding the columns and setting up things like primary keys and foreign key constraints. He also includes the SQL statements that it will generate and execute on your Doctrine-based connection.

1 comment voice your opinion now!
sql schema doctrine generate dbal mysql


blog comments powered by Disqus

Similar Posts

Mike Dalisay: Salt, Hash and Store Passwords Securely with Phpass

Job Posting: Bullseye Creative Seeks a PHP/MySQL Coder & Web Designer

Sematopia.com: How to - Backup MySQL database & email results using PHP

Richard Thomas' Blog: Solar Framework Shorts - Basic Sql Profiling

Vexxhost.com: Top 5 new (and cool!) features in PHP5 that you probably haven't heard of


Community Events











Don't see your event here?
Let us know!


composer install opinion series component language hhvm application podcast symfony2 code introduction package release unittest facebook overview hack framework security

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework