RE: [coldbox:13082] Straw Poll: Development databases

Hi Brad,

Yeah, local databases.

Test data is a troublesome one - I think the best way to do it is to keep a consistent limited set of data in place - how we do this however it much more challenging.

I'm going to swear again I'm afraid. Rails and Django both have a really great implementations called 'fixtures' that allow you to define test data in a flat file, JSON, XML, CSV - this gets imported into the empty schema and any changes rolled back while in development / testing.... so your test dataset is consistent all of the time.

I started placing together a CFML implementation, however, because of the way hibernate works, i'm not sure how viable it is, ensuring parent objects are saved before any relations are established was the biggest challenge, in Django where the ORM is less fussed about foreign constraints it was easier.

https://github.com/SirRawlins/cfixtures (it really is a VERY infant project, not even alpha)

However, I would love other people to get involved on something like this *cough* Luis *cough* John Wish *cough* :slight_smile:

Thanks.

Robert

We do something similar to what Curt described. All of our db changes are scripted and we have deployment scripts that run those migration scripts whenever a deployment is done. The db tracks what its current “migration level” is, and runs only the scripts that are greater to that level.

As for local devs, all use their own databases with a very basic set of test data. This is all contained in a “db-init” SQL script. We also have the notion of deployments for our local environments, which includes a fresh wiping/rebuilding of the local database (using the aforementioned db-init script). On the somewhat rare chance we need a copy of the production database locally, we can pull that down as a dump and run it. When finished with whatever we momentarily needed it for, we do another local “deployment”, which gets us right back to the development state that we need to be in.

We also have staging servers for each project, which are (obviously) shared and tested heavily against prior to anything being deployed to production.

HTH

Robert, you can avoid the problems you have by removing constraints in the database. Most databases have the ability to turn on/off constraints. So you could turn them off, insert mock data, test, then delete data, and turn constraints back on.

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

Interesting approach Luis,

And I imagine they would have the ability to do this programatically (through SQL?)

May have to dust off my project and have a look at that.

Robert

Yes, here is an example for MSSQL

ALTER TABLE #arguments.table# NOCHECK CONSTRAINT ALL ALTER TABLE #arguments.table# CHECK CONSTRAINT ALL

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

Brilliant Luis,

Interestingly enough I think this is effectively what Django does for it’s fixtures.

Robert

well, let’s build it then :slight_smile:

I had fixtures in the ColdBox roadmap a while back, never got to it. Same as migrations. This could be a fixtures module :slight_smile:

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

Sure Luis, I would love that.

It’s one huge hurdle that makes unit / integration testing at the moment so difficult.

Do we have somewhere in the roadmap where we can discuss ideas a little further, establish a basic spec etc?

Robert

Hmm, we don’t, what suggestions could we have to have an open roadmap document and collaborators added? Google docs?

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

Something like UserVoice?

We use ZenDesk at the moment for discussions with users about roadmap features on our apps - alas, it’s quite an expensive option.

I was just having a look on Github, they don’t seem to have anything on there which can help, which is surprising.

Perhaps the google groups is the best place then?

Robert

I have ZenDesk, how do I enable that?

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

It’s in the forums.

Create a new forum, and it’ll ask you for the type of forum - choose ‘Ideas’

Topics can then be posted, discussed, voted on, and status changed to ‘Planned’, ‘In Progress’ or ‘Done’ etc.

Robert

I did that, but it becomes visible to non-authenticated users, which is fine, but then only auth users can submit ideas as my support services are not open, any suggestions?

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

Hmm I don’t know I’m afraid, we only use it with logged in users.

Perhaps start a conversation with ZenDesk about it? Send them a email or tweet, they response very quickly.

Robert