denny / ShinyCMS

ShinyCMS is an open source CMS. This is the Perl version, built with Catalyst and DBIC. (There is also a Ruby on Rails version: www.github.com/denny/ShinyCMS-ruby)
56 stars 24 forks source link

Developing ShinyCMS to be database agnostic #7

Closed three18ti closed 12 years ago

three18ti commented 12 years ago

Hello,

First I would like to say ShinyCMS is a great product. I am looking at developing my own site and am leaning towards adapting ShinyCMS to my needs.

I'm not really sure that this is an "issue", but I didn't see a better place to open a discussion.

Would it be possible, instead of writing the SQL schema as SQL, write the DBIx schema directly, then use DBIx to generate the database schema? I realize this might take more work at the outset (especially since you've already written the SQL schema), but in the long run would allow the DB to be managed pragmatically, allowing the application to be DB agnostic and providing an easy method for upgrade paths.

what do you think? Am I way off?

Thanks for reading, and thanks for providing an awesome product.

Best Regards, three18ti

Edit: I would like to volunteer to undertake or assist the undertaking of this change.

denny commented 12 years ago

Hi,

The database/schema.sql that's included isn't actually used in any part of the documented deployment process. I generate the DBIC files from my database (using bin/dev-tools/regenerate-db-modules) and the database is deployed from those files using DBIC's ->deploy() method (by bin/database/deploy-schema). I think this is what you're suggesting? If so, that's how it already works. :)

I might move the schema.sql into the docs/ folder so that it's clearer that it's just a reference document these days - you're not the first person to be confused by it.

Cheers, Denny