LWN.net Logo

Database Templates with MySQL (O'Reilly)

Russell Dyer writes about Database Templates on O'Reilly. "Once you've built several MySQL databases, you'll learn some shortcuts to database design. Many databases are very similar. When creating new databases, developers often build the same basic tables with only slightly different names and some adjustments to columns. Rather than starting from scratch when putting together a new database, developers will sometimes copy tables from an existing database, give them new names, and then make modifications. This can be a big timesaver."
(Log in to post comments)

Database Templates with MySQL (O'Reilly)

Posted Mar 26, 2004 18:49 UTC (Fri) by maney (subscriber, #12630) [Link]

Commenting in Slashdot mode, viz., without bothering to read more than the quoted snippet...

Rather than starting from scratch when putting together a new database, developers will sometimes copy tables from an existing database, give them new names, and then make modifications. This can be a big timesaver.

Really? Guess they must do a lot of rebuilding much the same application, eh? was the unavoidable first thought. The more serious one that followed hard on its heels is that these guys must never have written down their schemas. SQL isn't my very first choice for doing that, but it has the advantage that it can be fed into the database (psql template1; create database new_one; \connect new_one; \i stock_schema - and those few commands can be scripted if you're ripping off a new one so often that those few seconds are worth worrying about).

Of course, you may choose to modify the schema in text form first; then you'll have a schema with which to recreate the new design at need. Copying a database in order to muck with it sounds awfully I only have a hammer, so I can pound sand! to me. Or does my relative ignorance of MySQL and its standar accessories reveal itself in an assumption that they have more than just the hammer at hand?

Copyright © 2004, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds