Login | Register  
Latest 20 PostsMinimize
09 Mar 2010 06:23 AM
09 Mar 2010 01:29 AM
08 Mar 2010 09:25 AM
08 Mar 2010 09:16 AM
08 Mar 2010 08:46 AM
08 Mar 2010 08:38 AM
07 Mar 2010 10:57 PM
07 Mar 2010 10:51 PM
07 Mar 2010 06:37 PM
07 Mar 2010 06:05 PM
07 Mar 2010 06:01 PM
07 Mar 2010 05:38 PM
07 Mar 2010 10:57 AM
07 Mar 2010 10:40 AM
07 Mar 2010 10:12 AM
07 Mar 2010 09:56 AM
07 Mar 2010 09:39 AM
07 Mar 2010 06:28 AM
07 Mar 2010 01:17 AM
06 Mar 2010 11:37 PM
ForumsMinimize
DB Changes and Unit Tests
Last Post 14 Dec 2009 12:25 AM byFastalanasa. 7 Replies.
Printer Friendly
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
AuthorMessages
BenUser is Offline
The Uncanny Gecko
New Member
New Member
Send Private Message
Posts:88
Avatar

--
13 Dec 2009 05:13 PM  

One of the biggest challenges I have been having is keeping the checked in db in line with the version of the db under my bin folder.  Like with Parent Usage, I had tried to keep it updated, but screwed it up.

I have also been trying to keep the SQL Script up to date as I go. 

So one thing I would like to do is

  1. Get the SQL script all up to date
  2. Have cruise control generate the database
  3. Run an expanded set of unit tests against this generated database.

I think that might catch some of these types of problems faster.

Does this sound possible?

 

FastalanasaUser is Offline
Grumpy Half-Elf
Advanced Member
Advanced Member
Send Private Message
Posts:555
Avatar

--
13 Dec 2009 05:23 PM  
1 and 3 are doable. I have no idea how to setup #2 though. I do need to update our version of CruiseControl to whatever is the latest, so might as well see if I can find an obvious way of doing this.

One thing that we might want to look at, is to make the sql script re-entrant. Meaning that it can be run, so that it can recreate/reset the database. I do this with my SQL Server scripts at consulting gigs.
BenUser is Offline
The Uncanny Gecko
New Member
New Member
Send Private Message
Posts:88
Avatar

--
13 Dec 2009 07:56 PM  
Dropping all tables, and rebuilding should be pretty easy. I will work on getting 1. and that as a solution for 2. Then we can build out 3 over time.

I think that will help with database changes.
KarakUser is Offline
Locutus of WheelMUD
Basic Member
Basic Member
Send Private Message
Posts:320
Avatar

--
13 Dec 2009 08:38 PM  

Maybe we could consider writing some C# code which regenerates the DB for now upon startup; this would give us the benefits of source control, much better merging, etc. Basically there'd be the DROP/CREATE TABLE commands and a sequence of INSERT statements in a C# file that would be easier to manage at this point than trying to deal with the crappy SQLite manager programs.  Maybe that'd be easier for various developers, regardless of their SQL experience, to work with for now.  Also the recurring "File Not Found" issues would go away for now so new users would be less likely to hit such a roadblock.

Some time nearer to v1.0 we'd likely want some other process here, but I'm not sure what that is yet. I did run into what claimed it was a DB Version Control software but after reading deeper, it didn't end up doing anything at all what such a theoretical thing should do; no rollbacks/merging/diffing/etc.

FastalanasaUser is Offline
Grumpy Half-Elf
Advanced Member
Advanced Member
Send Private Message
Posts:555
Avatar

--
13 Dec 2009 08:41 PM  

This is called Migrations in the Ruby world. I remember seeing something like "Rik Migrations" a while back. I believe that there at least a couple frameworks for .NET Migration operations. I'll see what I can dig up.

Here's a roundup of the currently available Migration frameworks:

http://flux88.com/blog/net-database-migration-tool-roundup/

BenUser is Offline
The Uncanny Gecko
New Member
New Member
Send Private Message
Posts:88
Avatar

--
13 Dec 2009 08:44 PM  
I kind of like that Idea.

Maybe with a flag to generate content or not. Would give you a nice way to build the database clean for a new story/game. We could include a command line utility maybe to build the db.
BenUser is Offline
The Uncanny Gecko
New Member
New Member
Send Private Message
Posts:88
Avatar

--
13 Dec 2009 09:08 PM  
Not sure I like the idea of that level of coding of a database that come with my quick look at the Migrations. Of course I haven't used it.

I was more of the mind to load the sql script from a file and run it.
FastalanasaUser is Offline
Grumpy Half-Elf
Advanced Member
Advanced Member
Send Private Message
Posts:555
Avatar

--
14 Dec 2009 12:25 AM  
Posted By Ben on 12/13/2009 2:08 PM
I was more of the mind to load the sql script from a file and run it.


I'm of the mind that simpler is better. Running a sql script looks simpler to me. Lets just try that for now.

You are not authorized to post a reply.

Active Forums 4.1
Copyright 2007-2009 by WheelMUD  | Terms Of Use | Privacy Statement
Google Analytics Alternative