<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>Glenn F. Henriksen</title>
    <link>http://www.henriksen.no/</link>
    <description>My digital notepad</description>
    <language>en-us</language>
    <copyright>Glenn F. Henriksen</copyright>
    <lastBuildDate>Fri, 04 Sep 2009 13:21:12 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.0.7226.0</generator>
    <managingEditor>blog@henriksen.no</managingEditor>
    <webMaster>blog@henriksen.no</webMaster>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/GlennFHenriksen" /><feedburner:info uri="glennfhenriksen" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
      <trackback:ping>http://www.henriksen.no/Trackback.aspx?guid=e409b5cb-9240-4bf7-8cdb-ee23cbd743d9</trackback:ping>
      <pingback:server>http://www.henriksen.no/pingback.aspx</pingback:server>
      <pingback:target>http://www.henriksen.no/PermaLink,guid,e409b5cb-9240-4bf7-8cdb-ee23cbd743d9.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.henriksen.no/CommentView,guid,e409b5cb-9240-4bf7-8cdb-ee23cbd743d9.aspx</wfw:comment>
      <wfw:commentRss>http://www.henriksen.no/SyndicationService.asmx/GetEntryCommentsRss?guid=e409b5cb-9240-4bf7-8cdb-ee23cbd743d9</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I delivered two talks on NNUG Stavanger on Sept. 3rd: Mocking and Cloud Computing.
Both can be downloaded from SlideShare:
</p>
        <p>
        </p>
        <div style="text-align: left; width: 425px" id="__ss_1951623">
          <a style="margin: 12px 0px 3px; display: block; font: 14px helvetica,arial,sans-serif; text-decoration: underline" title="Mocking" href="http://www.slideshare.net/glennhenriksen/mocking">Mocking</a>
          <object style="margin:0px" width="425" height="355">
            <param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=mocking-nnug-090904082916-phpapp01&amp;rel=0&amp;stripped_title=mocking" />
            <param name="allowFullScreen" value="true" />
            <param name="allowScriptAccess" value="always" />
            <embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=mocking-nnug-090904082916-phpapp01&amp;rel=0&amp;stripped_title=mocking" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355">
            </embed>
          </object>
        </div>
        <p>
        </p>
        <p>
          <a href="http://www.slideshare.net/glennhenriksen/mocking/download">Download presentation</a>
        </p>
        <p>
The source code for the Mocking example can <a href="http://github.com/henriksen/NNUG-20090903-Mocking/tree/master">be
found on Github</a>. It’s not much but if you want it, it’s there. 
</p>
        <p>
        </p>
        <div style="text-align: left; width: 425px" id="__ss_1951621">
          <a style="margin: 12px 0px 3px; display: block; font: 14px helvetica,arial,sans-serif; text-decoration: underline" title="Cloud Computing Dnd 20090827" href="http://www.slideshare.net/glennhenriksen/cloud-computing-dnd-20090827">Cloud
Computing Dnd 20090827</a>
          <object style="margin:0px" width="425" height="355">
            <param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=cloudcomputingdnd20090827-090904082826-phpapp01&amp;rel=0&amp;stripped_title=cloud-computing-dnd-20090827" />
            <param name="allowFullScreen" value="true" />
            <param name="allowScriptAccess" value="always" />
            <embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=cloudcomputingdnd20090827-090904082826-phpapp01&amp;rel=0&amp;stripped_title=cloud-computing-dnd-20090827" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355">
            </embed>
          </object>
        </div>
        <p>
        </p>
        <p>
          <a href="http://www.slideshare.net/glennhenriksen/cloud-computing-dnd-20090827/download">
            <a href="http://www.slideshare.net/glennhenriksen/mocking/download">Download </a>presentation</a>
        </p>
        <p>
Someone asked me if NHibernate would work with SQL Azure and, <a href="http://ayende.com/Blog/archive/2009/09/05/nhibernate-on-the-cloud-sql-azure.aspx">according
to Ayende</a>, it does! 
</p>
        <img width="0" height="0" src="http://www.henriksen.no/aggbug.ashx?id=e409b5cb-9240-4bf7-8cdb-ee23cbd743d9" />
      </body>
      <title>Slides from NNUG</title>
      <guid isPermaLink="false">http://www.henriksen.no/PermaLink,guid,e409b5cb-9240-4bf7-8cdb-ee23cbd743d9.aspx</guid>
      <link>http://feedproxy.google.com/~r/GlennFHenriksen/~3/ZEgLW9Wi0ss/SlidesFromNNUG.aspx</link>
      <pubDate>Fri, 04 Sep 2009 13:21:12 GMT</pubDate>
      <description>&lt;p&gt;
I delivered two talks on NNUG Stavanger on Sept. 3rd: Mocking and Cloud Computing.
Both can be downloaded from SlideShare:
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;div style="text-align: left; width: 425px" id="__ss_1951623"&gt;&lt;a style="margin: 12px 0px 3px; display: block; font: 14px helvetica,arial,sans-serif; text-decoration: underline" title="Mocking" href="http://www.slideshare.net/glennhenriksen/mocking"&gt;Mocking&lt;/a&gt;
&lt;object style="margin:0px" width="425" height="355"&gt;
&lt;param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=mocking-nnug-090904082916-phpapp01&amp;amp;rel=0&amp;amp;stripped_title=mocking" /&gt;
&lt;param name="allowFullScreen" value="true" /&gt;
&lt;param name="allowScriptAccess" value="always" /&gt;&lt;embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=mocking-nnug-090904082916-phpapp01&amp;amp;rel=0&amp;amp;stripped_title=mocking" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"&gt;&lt;/embed&gt;
&lt;/object&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.slideshare.net/glennhenriksen/mocking/download"&gt;Download presentation&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
The source code for the Mocking example can &lt;a href="http://github.com/henriksen/NNUG-20090903-Mocking/tree/master"&gt;be
found on Github&lt;/a&gt;. It’s not much but if you want it, it’s there. 
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;div style="text-align: left; width: 425px" id="__ss_1951621"&gt;&lt;a style="margin: 12px 0px 3px; display: block; font: 14px helvetica,arial,sans-serif; text-decoration: underline" title="Cloud Computing Dnd 20090827" href="http://www.slideshare.net/glennhenriksen/cloud-computing-dnd-20090827"&gt;Cloud
Computing Dnd 20090827&lt;/a&gt;
&lt;object style="margin:0px" width="425" height="355"&gt;
&lt;param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=cloudcomputingdnd20090827-090904082826-phpapp01&amp;amp;rel=0&amp;amp;stripped_title=cloud-computing-dnd-20090827" /&gt;
&lt;param name="allowFullScreen" value="true" /&gt;
&lt;param name="allowScriptAccess" value="always" /&gt;&lt;embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=cloudcomputingdnd20090827-090904082826-phpapp01&amp;amp;rel=0&amp;amp;stripped_title=cloud-computing-dnd-20090827" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"&gt;&lt;/embed&gt;
&lt;/object&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.slideshare.net/glennhenriksen/cloud-computing-dnd-20090827/download"&gt;&lt;a href="http://www.slideshare.net/glennhenriksen/mocking/download"&gt;Download &lt;/a&gt;presentation&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Someone asked me if NHibernate would work with SQL Azure and, &lt;a href="http://ayende.com/Blog/archive/2009/09/05/nhibernate-on-the-cloud-sql-azure.aspx"&gt;according
to Ayende&lt;/a&gt;, it does! 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.henriksen.no/aggbug.ashx?id=e409b5cb-9240-4bf7-8cdb-ee23cbd743d9" /&gt;</description>
      <comments>http://www.henriksen.no/CommentView,guid,e409b5cb-9240-4bf7-8cdb-ee23cbd743d9.aspx</comments>
      <category>Presentations</category>
    <feedburner:origLink>http://www.henriksen.no/2009/09/04/SlidesFromNNUG.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.henriksen.no/Trackback.aspx?guid=f2874e6c-ece7-475d-bf3e-be544c3631ed</trackback:ping>
      <pingback:server>http://www.henriksen.no/pingback.aspx</pingback:server>
      <pingback:target>http://www.henriksen.no/PermaLink,guid,f2874e6c-ece7-475d-bf3e-be544c3631ed.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.henriksen.no/CommentView,guid,f2874e6c-ece7-475d-bf3e-be544c3631ed.aspx</wfw:comment>
      <wfw:commentRss>http://www.henriksen.no/SyndicationService.asmx/GetEntryCommentsRss?guid=f2874e6c-ece7-475d-bf3e-be544c3631ed</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Just a quick note, as much to my self as anyone else. I’m getting started with Git
and wanted to use notepad++ as the editor for commits. 
</p>
        <p>
So I followed some <a href="http://learn.github.com/p/setup.html">basic instructions</a> and
tried setting it up like this: 
</p>
        <pre>git config --global core.editor "c:\Program Files (x86)\Notepad++\notepad++.exe"</pre>
        <p>
and got this:
</p>
        <pre>
          <p>
c:\Program Files (x86)\Notepad++\notepad++.exe: -c: line 0: syntax error near unexpected
token `('<br />
c:\Program Files (x86)\Notepad++\notepad++.exe: -c: line 0: `c:\Program Files (x86)\Notepad++\notepad++.exe
\$@\'<br />
error: There was a problem with the editor 'c:\Program Files (x86)\Notepad++\notepad++.exe'.<br />
Please supply the message using either -m or -F option. 
</p>
        </pre>
        <p>
Helpful… 
</p>
        <p>
  
</p>
        <p>
Different variations yielded the same results: 
</p>
        <pre>git config --global core.editor '"c:\Program Files (x86)\Notepad++\notepad++.exe"' 
git config --global core.editor 'c:\Program Files (x86)\Notepad++\notepad++.exe' 
git config --global core.editor "'c:\Program Files (x86)\Notepad++\notepad++.exe'" </pre>
        <p>
Until <a href="http://stackoverflow.com/questions/10564/how-can-i-set-up-an-editor-to-work-with-git-on-windows/1083830#1083830">this
Stack Overflow answer</a> pointed me in the right direction: 
</p>
        <pre>git config --global core.editor "'c:/Program Files (x86)/Notepad++/notepad++.exe'"</pre>
        <p>
So, keep those slashes going the right way
</p>
        <img width="0" height="0" src="http://www.henriksen.no/aggbug.ashx?id=f2874e6c-ece7-475d-bf3e-be544c3631ed" />
      </body>
      <title>Using notepad++ as editor for Git source control</title>
      <guid isPermaLink="false">http://www.henriksen.no/PermaLink,guid,f2874e6c-ece7-475d-bf3e-be544c3631ed.aspx</guid>
      <link>http://feedproxy.google.com/~r/GlennFHenriksen/~3/wgBYaiaKj44/UsingNotepadAsEditorForGitSourceControl.aspx</link>
      <pubDate>Tue, 01 Sep 2009 07:32:04 GMT</pubDate>
      <description>&lt;p&gt;
Just a quick note, as much to my self as anyone else. I’m getting started with Git
and wanted to use notepad++ as the editor for commits. 
&lt;/p&gt;
&lt;p&gt;
So I followed some &lt;a href="http://learn.github.com/p/setup.html"&gt;basic instructions&lt;/a&gt; and
tried setting it up like this: 
&lt;/p&gt;
&lt;pre&gt;git config --global core.editor "c:\Program Files (x86)\Notepad++\notepad++.exe"&lt;/pre&gt;
&lt;p&gt;
and got this:
&lt;/p&gt;
&lt;pre&gt;
&lt;p&gt;
c:\Program Files (x86)\Notepad++\notepad++.exe: -c: line 0: syntax error near unexpected
token `('&lt;br&gt;
c:\Program Files (x86)\Notepad++\notepad++.exe: -c: line 0: `c:\Program Files (x86)\Notepad++\notepad++.exe
\$@\'&lt;br&gt;
error: There was a problem with the editor 'c:\Program Files (x86)\Notepad++\notepad++.exe'.&lt;br&gt;
Please supply the message using either -m or -F option. 
&lt;/p&gt;
&lt;/pre&gt;
&lt;p&gt;
Helpful… 
&lt;p&gt;
&amp;nbsp; 
&lt;p&gt;
Different variations yielded the same results: &lt;pre&gt;git config --global core.editor '"c:\Program Files (x86)\Notepad++\notepad++.exe"' 
git config --global core.editor 'c:\Program Files (x86)\Notepad++\notepad++.exe' 
git config --global core.editor "'c:\Program Files (x86)\Notepad++\notepad++.exe'" &lt;/pre&gt;
&lt;p&gt;
Until &lt;a href="http://stackoverflow.com/questions/10564/how-can-i-set-up-an-editor-to-work-with-git-on-windows/1083830#1083830"&gt;this
Stack Overflow answer&lt;/a&gt; pointed me in the right direction: 
&lt;/p&gt;
&lt;pre&gt;git config --global core.editor "'c:/Program Files (x86)/Notepad++/notepad++.exe'"&lt;/pre&gt;
&lt;p&gt;
So, keep those slashes going the right way
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.henriksen.no/aggbug.ashx?id=f2874e6c-ece7-475d-bf3e-be544c3631ed" /&gt;</description>
      <comments>http://www.henriksen.no/CommentView,guid,f2874e6c-ece7-475d-bf3e-be544c3631ed.aspx</comments>
    <feedburner:origLink>http://www.henriksen.no/2009/09/01/UsingNotepadAsEditorForGitSourceControl.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.henriksen.no/Trackback.aspx?guid=7df4266d-996c-4f65-9f4e-03aecf3dccea</trackback:ping>
      <pingback:server>http://www.henriksen.no/pingback.aspx</pingback:server>
      <pingback:target>http://www.henriksen.no/PermaLink,guid,7df4266d-996c-4f65-9f4e-03aecf3dccea.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.henriksen.no/CommentView,guid,7df4266d-996c-4f65-9f4e-03aecf3dccea.aspx</wfw:comment>
      <wfw:commentRss>http://www.henriksen.no/SyndicationService.asmx/GetEntryCommentsRss?guid=7df4266d-996c-4f65-9f4e-03aecf3dccea</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
A <a href="http://www.henriksen.no/2009/02/11/DatabaseMigrationsInCode.aspx">few days
ago I started trying some frameworks for maintaining my database migrations</a> in
code. I tried <a href="http://code.google.com/p/migratordotnet/">Migrator.NET</a> and
it didn’t quite ring with me. Now, I’ve been trying <a href="http://www.rikware.com/RikMigrations.html">RikMigrations</a> which
I initially liked better. 
</p>
        <p>
RikMigrations does the same as Migrator.NET, it allows you to define your database
in code and define the migration steps to bring a database from one point in the development
to another, and back again. 
</p>
        <div>
          <div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 1:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">class</span> Add_Event_Table
: IMigration</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 2:</span> {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 3:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">void</span> Up(Schema
db)</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 4:</span> {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 5:</span> Table
t = db.AddTable(<span style="color: #006080">"Event"</span>);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 6:</span> t.AddColumn&lt;<span style="color: #0000ff">int</span>&gt;(<span style="color: #006080">"ID"</span>).PrimaryKey().AutoGenerate();</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 7:</span> t.AddColumn&lt;<span style="color: #0000ff">string</span>&gt;(<span style="color: #006080">"Name"</span>,
256).NotNull();</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 8:</span> t.Save();</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 9:</span> }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 10:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">void</span> Down(Schema
db)</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 11:</span> {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 12:</span> db.DropTable(<span style="color: #006080">"Event"</span>);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 13:</span> }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 14:</span> }</pre>
          </div>
        </div>
        <p>
Each migration step is a class implementing the IMigration interface: an Up() and
a Down() method. Those methods contains the steps to move the database forward or
backwards in the development, respectively. I haven’t used Ruby on Rails but from
what I’ve seen, much of the inspiration from RoR. 
</p>
        <p>
The advantages for a tool like this is that your database is under source control,
it’s easier for multiple developers to work on the same code and make changes to the
database and you can roll back the database to a known state and point in time. You
can also use it to deploy changes to the database into a test, QA or even production
environment.
</p>
        <p>
You add multiple classes for multiple migrations and specify the order of the migrations
in assembly directives:
</p>
        <div>
          <div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 1:</span> [assembly:
Migration(<span style="color: #0000ff">typeof</span>(Add_Event_Table), 1)]</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 2:</span> [assembly:
Migration(<span style="color: #0000ff">typeof</span>(Alter_Event_Table_Add_start_and_end_date),
2)]</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 3:</span> [assembly:
Migration(<span style="color: #0000ff">typeof</span>(Alter_Event_Table_Add_Description),
3)]</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 4:</span>  </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 5:</span>
              <span style="color: #0000ff">namespace</span> GeekBeer.Data.DBMigration
{</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 6:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">class</span> Add_Event_Table
: IMigration</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 7:</span> {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 8:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">void</span> Up(Schema
db) ...</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 9:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">void</span> Down(Schema
db) ...</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 10:</span> }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 11:</span>  </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 12:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">class</span> Alter_Event_Table_Add_start_and_end_date
: IMigration</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 13:</span> {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 14:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">void</span> Up(Schema
db) ...</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 15:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">void</span> Down(Schema
db) ...</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 16:</span> }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 17:</span>  </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 18:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">class</span> Alter_Event_Table_Add_Description
: IMigration</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 19:</span> {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 20:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">void</span> Up(Schema
db) ...</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 21:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">void</span> Down(Schema
db) ...</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 22:</span> }</pre>
          </div>
          <br />
(method implementations removed for clarity)
</div>
        <div> 
</div>
        <div>I can run my migrations from code, for instance in this ASP.NET MVC project I
just ran the migrations in the Global.aspx file, so that my database was always up-to-speed
(I wouldn’t recommend this for a production application). I could 
</div>
        <div> 
</div>
        <div>
          <div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 1:</span>
              <span style="color: #0000ff">protected</span>
              <span style="color: #0000ff">void</span> Application_Start()</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 2:</span> {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 3:</span>
              <span style="color: #008000">//
Run the database migrations, making sure that the database is up to speed. </span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 4:</span> var
rootWebConfig =</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 5:</span> System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(<span style="color: #006080">"/"</span>);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 6:</span> var
connString = rootWebConfig.ConnectionStrings.ConnectionStrings[<span style="color: #006080">"GeekBeerConnectionString"</span>];</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 7:</span> Data.DBMigration.MigrateDatabase.Migrate(connString.ConnectionString);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 8:</span> }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 9:</span>  </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 10:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">class</span> MigrateDatabase</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 11:</span> {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 12:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">static</span>
              <span style="color: #0000ff">void</span> Migrate(<span style="color: #0000ff">string</span> connectionString)
{</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 13:</span> DbProvider.DefaultConnectionString
= connectionString;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 14:</span> DbProvider
db = <span style="color: #0000ff">new</span> MssqlProvider(<span style="color: #0000ff">null</span>);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 15:</span> MigrationManager.UpgradeMax(Assembly.GetExecutingAssembly(),
db);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 16:</span> }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 17:</span>  </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 18:</span> }</pre>
          </div>
        </div>
        <p>
        </p>
        <p>
Works like a charm.
</p>
        <h2>Is it useful?
</h2>
        <p>
Short answer, for me personally: No. <a href="http://en.wiktionary.org/wiki/your_mileage_may_vary">YMMV</a>.
</p>
        <p>
I’m pretty comfortable with creating and changing SQL tables, columns and relations
in SQL Management Studio. I’m not that comfortable with doing it in what’s effectively
a new <a href="http://en.wikipedia.org/wiki/Domain_Specific_Language">DSL</a> for
creating and editing databases. It adds friction that I don’t need and I don’t really
see the need to learn a new language for SQL editing. SQL does that job pretty well
and with SQL Management Studio I can use designers and have my change code generated
for me (though it’s not always that nice code…) 
</p>
        <p>
It would most likely get easier over time, most likely, but I have other things I
feel is more important to learn. There are also things that are not easily expressed
in the current API, such as indexes. 
</p>
        <p>
This is also a problem with Migrator.NET which I tried last time. 
</p>
        <p>
The concept of database migrations is still interesting to me though, but I think
I’m going to go for one of the solutions that uses plain SQL scripts for the migration.
I think I’m going to try <a href="http://dbdeploy.com/2007/09/25/dbdeploynet-v10-officially-released/">DBDeploy.NET</a> next. 
</p>
        <img width="0" height="0" src="http://www.henriksen.no/aggbug.ashx?id=7df4266d-996c-4f65-9f4e-03aecf3dccea" />
      </body>
      <title>Database migrations in code &amp;ndash; Part 2: RikMigrations</title>
      <guid isPermaLink="false">http://www.henriksen.no/PermaLink,guid,7df4266d-996c-4f65-9f4e-03aecf3dccea.aspx</guid>
      <link>http://feedproxy.google.com/~r/GlennFHenriksen/~3/t5IPrT50YWA/DatabaseMigrationsInCodeNdashPart2RikMigrations.aspx</link>
      <pubDate>Sun, 15 Feb 2009 12:53:52 GMT</pubDate>
      <description>&lt;p&gt;
A &lt;a href="http://www.henriksen.no/2009/02/11/DatabaseMigrationsInCode.aspx"&gt;few days
ago I started trying some frameworks for maintaining my database migrations&lt;/a&gt; in
code. I tried &lt;a href="http://code.google.com/p/migratordotnet/"&gt;Migrator.NET&lt;/a&gt; and
it didn’t quite ring with me. Now, I’ve been trying &lt;a href="http://www.rikware.com/RikMigrations.html"&gt;RikMigrations&lt;/a&gt; which
I initially liked better. 
&lt;/p&gt;
&lt;p&gt;
RikMigrations does the same as Migrator.NET, it allows you to define your database
in code and define the migration steps to bring a database from one point in the development
to another, and back again. 
&lt;/p&gt;
&lt;div&gt;
&lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Add_Event_Table
: IMigration&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 2:&lt;/span&gt; {&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Up(Schema
db)&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 4:&lt;/span&gt; {&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 5:&lt;/span&gt; Table
t = db.AddTable(&lt;span style="color: #006080"&gt;"Event"&lt;/span&gt;);&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 6:&lt;/span&gt; t.AddColumn&amp;lt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;&amp;gt;(&lt;span style="color: #006080"&gt;"ID"&lt;/span&gt;).PrimaryKey().AutoGenerate();&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 7:&lt;/span&gt; t.AddColumn&amp;lt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;&amp;gt;(&lt;span style="color: #006080"&gt;"Name"&lt;/span&gt;,
256).NotNull();&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 8:&lt;/span&gt; t.Save();&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 9:&lt;/span&gt; }&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 10:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Down(Schema
db)&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 11:&lt;/span&gt; {&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 12:&lt;/span&gt; db.DropTable(&lt;span style="color: #006080"&gt;"Event"&lt;/span&gt;);&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 13:&lt;/span&gt; }&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 14:&lt;/span&gt; }&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
Each migration step is a class implementing the IMigration interface: an Up() and
a Down() method. Those methods contains the steps to move the database forward or
backwards in the development, respectively. I haven’t used Ruby on Rails but from
what I’ve seen, much of the inspiration from RoR. 
&lt;/p&gt;
&lt;p&gt;
The advantages for a tool like this is that your database is under source control,
it’s easier for multiple developers to work on the same code and make changes to the
database and you can roll back the database to a known state and point in time. You
can also use it to deploy changes to the database into a test, QA or even production
environment.
&lt;/p&gt;
&lt;p&gt;
You add multiple classes for multiple migrations and specify the order of the migrations
in assembly directives:
&lt;/p&gt;
&lt;div&gt;
&lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 1:&lt;/span&gt; [assembly:
Migration(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(Add_Event_Table), 1)]&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 2:&lt;/span&gt; [assembly:
Migration(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(Alter_Event_Table_Add_start_and_end_date),
2)]&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 3:&lt;/span&gt; [assembly:
Migration(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(Alter_Event_Table_Add_Description),
3)]&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 4:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 5:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; GeekBeer.Data.DBMigration
{&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 6:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Add_Event_Table
: IMigration&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 7:&lt;/span&gt; {&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 8:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Up(Schema
db) ...&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 9:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Down(Schema
db) ...&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 10:&lt;/span&gt; }&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 11:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 12:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Alter_Event_Table_Add_start_and_end_date
: IMigration&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 13:&lt;/span&gt; {&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 14:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Up(Schema
db) ...&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 15:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Down(Schema
db) ...&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 16:&lt;/span&gt; }&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 17:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 18:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Alter_Event_Table_Add_Description
: IMigration&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 19:&lt;/span&gt; {&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 20:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Up(Schema
db) ...&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 21:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Down(Schema
db) ...&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 22:&lt;/span&gt; }&lt;/pre&gt;
&lt;/div&gt;
&lt;br&gt;
(method implementations removed for clarity)
&lt;/div&gt;
&lt;div&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;I can run my migrations from code, for instance in this ASP.NET MVC project I
just ran the migrations in the Global.aspx file, so that my database was always up-to-speed
(I wouldn’t recommend this for a production application). I could 
&lt;/div&gt;
&lt;div&gt;&amp;nbsp;
&lt;/div&gt;
&lt;div&gt;
&lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;protected&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Application_Start()&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 2:&lt;/span&gt; {&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 3:&lt;/span&gt; &lt;span style="color: #008000"&gt;//
Run the database migrations, making sure that the database is up to speed. &lt;/span&gt;&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 4:&lt;/span&gt; var
rootWebConfig =&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 5:&lt;/span&gt; System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration(&lt;span style="color: #006080"&gt;"/"&lt;/span&gt;);&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 6:&lt;/span&gt; var
connString = rootWebConfig.ConnectionStrings.ConnectionStrings[&lt;span style="color: #006080"&gt;"GeekBeerConnectionString"&lt;/span&gt;];&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 7:&lt;/span&gt; Data.DBMigration.MigrateDatabase.Migrate(connString.ConnectionString);&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 8:&lt;/span&gt; }&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 9:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 10:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; MigrateDatabase&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 11:&lt;/span&gt; {&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 12:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Migrate(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; connectionString)
{&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 13:&lt;/span&gt; DbProvider.DefaultConnectionString
= connectionString;&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 14:&lt;/span&gt; DbProvider
db = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; MssqlProvider(&lt;span style="color: #0000ff"&gt;null&lt;/span&gt;);&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 15:&lt;/span&gt; MigrationManager.UpgradeMax(Assembly.GetExecutingAssembly(),
db);&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 16:&lt;/span&gt; }&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 17:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 18:&lt;/span&gt; }&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Works like a charm.
&lt;/p&gt;
&lt;h2&gt;Is it useful?
&lt;/h2&gt;
&lt;p&gt;
Short answer, for me personally: No. &lt;a href="http://en.wiktionary.org/wiki/your_mileage_may_vary"&gt;YMMV&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
I’m pretty comfortable with creating and changing SQL tables, columns and relations
in SQL Management Studio. I’m not that comfortable with doing it in what’s effectively
a new &lt;a href="http://en.wikipedia.org/wiki/Domain_Specific_Language"&gt;DSL&lt;/a&gt; for
creating and editing databases. It adds friction that I don’t need and I don’t really
see the need to learn a new language for SQL editing. SQL does that job pretty well
and with SQL Management Studio I can use designers and have my change code generated
for me (though it’s not always that nice code…) 
&lt;/p&gt;
&lt;p&gt;
It would most likely get easier over time, most likely, but I have other things I
feel is more important to learn. There are also things that are not easily expressed
in the current API, such as indexes. 
&lt;/p&gt;
&lt;p&gt;
This is also a problem with Migrator.NET which I tried last time. 
&lt;/p&gt;
&lt;p&gt;
The concept of database migrations is still interesting to me though, but I think
I’m going to go for one of the solutions that uses plain SQL scripts for the migration.
I think I’m going to try &lt;a href="http://dbdeploy.com/2007/09/25/dbdeploynet-v10-officially-released/"&gt;DBDeploy.NET&lt;/a&gt; next. 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.henriksen.no/aggbug.ashx?id=7df4266d-996c-4f65-9f4e-03aecf3dccea" /&gt;</description>
      <comments>http://www.henriksen.no/CommentView,guid,7df4266d-996c-4f65-9f4e-03aecf3dccea.aspx</comments>
    <feedburner:origLink>http://www.henriksen.no/2009/02/15/DatabaseMigrationsInCodeNdashPart2RikMigrations.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.henriksen.no/Trackback.aspx?guid=dfec4619-c443-4bda-98a5-8ef6a803ca88</trackback:ping>
      <pingback:server>http://www.henriksen.no/pingback.aspx</pingback:server>
      <pingback:target>http://www.henriksen.no/PermaLink,guid,dfec4619-c443-4bda-98a5-8ef6a803ca88.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.henriksen.no/CommentView,guid,dfec4619-c443-4bda-98a5-8ef6a803ca88.aspx</wfw:comment>
      <wfw:commentRss>http://www.henriksen.no/SyndicationService.asmx/GetEntryCommentsRss?guid=dfec4619-c443-4bda-98a5-8ef6a803ca88</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Today I tried to find a good way to include the SQL schema in my code and thus in
source control. Having bookmarked a couple of frameworks in the past I finally got
the change to look closer at some. 
</p>
        <h2>
          <a href="http://code.google.com/p/migratordotnet/" target="_blank">Migrator.NET</a>
        </h2>
        <p>
This seems to be the fairly well maintained, it has <a href="http://code.google.com/p/migratordotnet/source/list" target="_blank">commits
in the past month</a> and lots of <a href="http://groups.google.com/group/migratordotnet-devel" target="_blank">patches
in the discussion group</a>, which is good. A few typos in the documentation wiki
that were <a href="http://code.google.com/p/migratordotnet/wiki/WritingMigrations" target="_blank">pointed
out months ago</a> without being fixed is not so good. Also, the documentation assumed
some features that were only present in the source tree, not in the release package. 
</p>
        <p>
The API interface leaves me somewhat lacking
</p>
        <div>
          <div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 1:</span> Database.AddTable(<span style="color: #006080">"Event"</span>,</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 2:</span>
              <span style="color: #0000ff">new</span> Column(<span style="color: #006080">"Id"</span>,
DbType.Int32, ColumnProperty.PrimaryKeyWithIdentity),</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 3:</span>
              <span style="color: #0000ff">new</span> Column(<span style="color: #006080">"Name"</span>,
DbType.String, </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 4:</span> ColumnProperty.Indexed
| ColumnProperty.NotNull),</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 5:</span>
              <span style="color: #0000ff">new</span> Column(<span style="color: #006080">"StartTime"</span>,
DbType.DateTime,</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 6:</span> ColumnProperty.Indexed
| ColumnProperty.NotNull),</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 7:</span>
              <span style="color: #0000ff">new</span> Column(<span style="color: #006080">"EndTime"</span>,
DbType.DateTime, ColumnProperty.Null)</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 8:</span> );</pre>
          </div>
        </div>
        <p>
I would have wished for a more fluent interface, but it works. 
</p>
        <p>
Each migration is a class, inheriting from Migration and implementing the Up() and
Down() methods. It uses class attributes to figure out the order of the migrations
and if they have been run. 
</p>
        <div>
          <div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 1:</span> [Migration(20090211235701)]</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 2:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">class</span> AddEventTable
: Migration {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 3:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">override</span>
              <span style="color: #0000ff">void</span> Up()
{</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 4:</span>  </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 5:</span> Database.AddTable(<span style="color: #006080">"Event"</span>,</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 6:</span>
              <span style="color: #0000ff">new</span> Column(<span style="color: #006080">"Id"</span>,
DbType.Int32, ColumnProperty.PrimaryKeyWithIdentity),</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 7:</span>
              <span style="color: #0000ff">new</span> Column(<span style="color: #006080">"Name"</span>,
DbType.String, </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 8:</span> ColumnProperty.Indexed
| ColumnProperty.NotNull),</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 9:</span>
              <span style="color: #0000ff">new</span> Column(<span style="color: #006080">"StartTime"</span>,
DbType.DateTime,</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 10:</span> ColumnProperty.Indexed
| ColumnProperty.NotNull),</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 11:</span>
              <span style="color: #0000ff">new</span> Column(<span style="color: #006080">"EndTime"</span>,
DbType.DateTime, ColumnProperty.Null)</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 12:</span> );</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 13:</span>
            </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 14:</span> }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 15:</span>  </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 16:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">override</span>
              <span style="color: #0000ff">void</span> Down()
{</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 17:</span> Database.RemoveTable(<span style="color: #006080">"Event"</span>);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 18:</span> }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 19:</span> }</pre>
          </div>
        </div>
        <p>
Information about which migration have been run against a database is stored in a
SchemaInfo table. 
</p>
        <p>
The database must be created in advance since the migration tool connects to the database
before running any migrations scripts. 
</p>
        <p>
        </p>
        <p>
        </p>
        <p>
Migrations.NET support several databases, including MS SQL, Oracle, MySQL and SQLite. 
</p>
        <p>
One problem I had was that ColumProperty.Indexed does not work and there is no way
to add an index to a table without adding custom SQL, thus negating some of the db-independence. 
</p>
        <p>
In the end, I’ve come to the conclusion that it’s nice, but missing some features
and that I don’t really like the API. Putting it aside for now. 
</p>
        <h2>
          <a href="http://www.rikware.com/RikMigrations.html" target="_blank">Rikmigrations</a>
        </h2>
        <p>
Rikmigrations uses the same Up()/Down() pattern but with a slightly different API
interface that I liked better. Here, the attributes are set on the assembly level
instead of the class level. I liked the class attributes from Migrator.NET better,
but this works too. 
</p>
        <div>
          <div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 1:</span>
              <span style="color: #0000ff">using</span> RikMigrations;</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 2:</span> [assembly:
Migration(<span style="color: #0000ff">typeof</span>(BlogMigration1), 1)]</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 3:</span> [assembly:
Migration(<span style="color: #0000ff">typeof</span>(BlogMigration2), 2)]</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 4:</span>
              <span style="color: #0000ff">namespace</span> Blog.Migrations</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 5:</span> {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 6:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">class</span> BlogMigration1
: IMigration</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 7:</span> {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 8:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">void</span> Up(DbProvider
db)</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 9:</span> {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 10:</span> Table
t = db.AddTable(<span style="color: #006080">"Blog"</span>);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 11:</span> t.AddColumn(<span style="color: #006080">"ID"</span>, <span style="color: #0000ff">typeof</span>(<span style="color: #0000ff">int</span>)).PrimaryKey().AutoGenerate();</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 12:</span> t.AddColumn(<span style="color: #006080">"Name"</span>, <span style="color: #0000ff">typeof</span>(<span style="color: #0000ff">string</span>),
64);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 13:</span> t.Save();</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 14:</span> }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 15:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">void</span> Down(DbProvider
db)</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 16:</span> {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 17:</span> db.DropTable(<span style="color: #006080">"Blog"</span>);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 18:</span> }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 19:</span>  </pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 20:</span> }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 21:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">class</span> BlogMigration2
: IMigration</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 22:</span> {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 23:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">void</span> Up(DbProvider
db)</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 24:</span> {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 25:</span> Table
t = db.AlterTable(<span style="color: #006080">"Blog"</span>);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 26:</span> t.AddColumn(<span style="color: #006080">"Description"</span>, <span style="color: #0000ff">typeof</span>(<span style="color: #0000ff">string</span>), <span style="color: #0000ff">int</span>.MaxValue);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 27:</span> t.Save();</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 28:</span> }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 29:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">void</span> Down(DbProvider
db)</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 30:</span> {</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 31:</span> Table
t = db.AlterTable(<span style="color: #006080">"Blog"</span>);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 32:</span> t.DropColumn(<span style="color: #006080">"Description"</span>);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 33:</span> t.Save();</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 34:</span> }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 35:</span> }</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 36:</span> }</pre>
          </div>
        </div>
        <p>
 
</p>
        <p>
It has some cool features like using generics to specify the data types:
</p>
        <div>
          <div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 1:</span> Table
t = db.AddTable(<span style="color: #006080">"Blog"</span>);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 2:</span> t.AddColumn&lt;<span style="color: #0000ff">int</span>&gt;(<span style="color: #006080">"ID"</span>);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 3:</span> t.AddColumn&lt;<span style="color: #0000ff">string</span>&gt;(<span style="color: #006080">"Name"</span>,
64);</pre>
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 4:</span> t.Save();</pre>
          </div>
        </div>
        <p>
          <br />
and inserting default data into a table:
</p>
        <div>
          <div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
            <pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060"> 1:</span> db.InsertDataInto(<span style="color: #006080">"Table1"</span>, <span style="color: #0000ff">new</span> {
ID = 1, Name = <span style="color: #006080">"Hello World"</span> }, <span style="color: #0000ff">true</span>);</pre>
          </div>
        </div>
        <p>
          <br />
It looks like it’s also missing the feature to add an index, but from what I’ve glanced
at the code, it shouldn’t be that hard to implement (this might just come back to
haunt me…)
</p>
        <p>
The documentation isn’t much and what little there is seems to be pretty old, but
the code doesn’t look that hard to just figure out so I don’t think it will be much
of a problem.
</p>
        <p>
I didn’t get a chance to try this today but tomorrow I’m going to take it for a spin.
There’s a couple of others I’d like to try as well. Watch this space for more.
</p>
        <img width="0" height="0" src="http://www.henriksen.no/aggbug.ashx?id=dfec4619-c443-4bda-98a5-8ef6a803ca88" />
      </body>
      <title>Database migrations in code</title>
      <guid isPermaLink="false">http://www.henriksen.no/PermaLink,guid,dfec4619-c443-4bda-98a5-8ef6a803ca88.aspx</guid>
      <link>http://feedproxy.google.com/~r/GlennFHenriksen/~3/xU8QIx9L39c/DatabaseMigrationsInCode.aspx</link>
      <pubDate>Wed, 11 Feb 2009 23:58:58 GMT</pubDate>
      <description>&lt;p&gt;
Today I tried to find a good way to include the SQL schema in my code and thus in
source control. Having bookmarked a couple of frameworks in the past I finally got
the change to look closer at some. 
&lt;/p&gt;
&lt;h2&gt;&lt;a href="http://code.google.com/p/migratordotnet/" target="_blank"&gt;Migrator.NET&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;
This seems to be the fairly well maintained, it has &lt;a href="http://code.google.com/p/migratordotnet/source/list" target="_blank"&gt;commits
in the past month&lt;/a&gt; and lots of &lt;a href="http://groups.google.com/group/migratordotnet-devel" target="_blank"&gt;patches
in the discussion group&lt;/a&gt;, which is good. A few typos in the documentation wiki
that were &lt;a href="http://code.google.com/p/migratordotnet/wiki/WritingMigrations" target="_blank"&gt;pointed
out months ago&lt;/a&gt; without being fixed is not so good. Also, the documentation assumed
some features that were only present in the source tree, not in the release package. 
&lt;/p&gt;
&lt;p&gt;
The API interface leaves me somewhat lacking
&lt;/p&gt;
&lt;div&gt;
&lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 1:&lt;/span&gt; Database.AddTable(&lt;span style="color: #006080"&gt;"Event"&lt;/span&gt;,&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Column(&lt;span style="color: #006080"&gt;"Id"&lt;/span&gt;,
DbType.Int32, ColumnProperty.PrimaryKeyWithIdentity),&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Column(&lt;span style="color: #006080"&gt;"Name"&lt;/span&gt;,
DbType.String, &lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 4:&lt;/span&gt; ColumnProperty.Indexed
| ColumnProperty.NotNull),&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 5:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Column(&lt;span style="color: #006080"&gt;"StartTime"&lt;/span&gt;,
DbType.DateTime,&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 6:&lt;/span&gt; ColumnProperty.Indexed
| ColumnProperty.NotNull),&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 7:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Column(&lt;span style="color: #006080"&gt;"EndTime"&lt;/span&gt;,
DbType.DateTime, ColumnProperty.Null)&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 8:&lt;/span&gt; );&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
I would have wished for a more fluent interface, but it works. 
&lt;/p&gt;
&lt;p&gt;
Each migration is a class, inheriting from Migration and implementing the Up() and
Down() methods. It uses class attributes to figure out the order of the migrations
and if they have been run. 
&lt;/p&gt;
&lt;div&gt;
&lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 1:&lt;/span&gt; [Migration(20090211235701)]&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 2:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; AddEventTable
: Migration {&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 3:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Up()
{&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 4:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 5:&lt;/span&gt; Database.AddTable(&lt;span style="color: #006080"&gt;"Event"&lt;/span&gt;,&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 6:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Column(&lt;span style="color: #006080"&gt;"Id"&lt;/span&gt;,
DbType.Int32, ColumnProperty.PrimaryKeyWithIdentity),&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 7:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Column(&lt;span style="color: #006080"&gt;"Name"&lt;/span&gt;,
DbType.String, &lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 8:&lt;/span&gt; ColumnProperty.Indexed
| ColumnProperty.NotNull),&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 9:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Column(&lt;span style="color: #006080"&gt;"StartTime"&lt;/span&gt;,
DbType.DateTime,&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 10:&lt;/span&gt; ColumnProperty.Indexed
| ColumnProperty.NotNull),&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 11:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; Column(&lt;span style="color: #006080"&gt;"EndTime"&lt;/span&gt;,
DbType.DateTime, ColumnProperty.Null)&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 12:&lt;/span&gt; );&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 13:&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 14:&lt;/span&gt; }&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 15:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 16:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;override&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Down()
{&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 17:&lt;/span&gt; Database.RemoveTable(&lt;span style="color: #006080"&gt;"Event"&lt;/span&gt;);&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 18:&lt;/span&gt; }&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 19:&lt;/span&gt; }&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
Information about which migration have been run against a database is stored in a
SchemaInfo table. 
&lt;/p&gt;
&lt;p&gt;
The database must be created in advance since the migration tool connects to the database
before running any migrations scripts. 
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Migrations.NET support several databases, including MS SQL, Oracle, MySQL and SQLite. 
&lt;/p&gt;
&lt;p&gt;
One problem I had was that ColumProperty.Indexed does not work and there is no way
to add an index to a table without adding custom SQL, thus negating some of the db-independence. 
&lt;/p&gt;
&lt;p&gt;
In the end, I’ve come to the conclusion that it’s nice, but missing some features
and that I don’t really like the API. Putting it aside for now. 
&lt;/p&gt;
&lt;h2&gt;&lt;a href="http://www.rikware.com/RikMigrations.html" target="_blank"&gt;Rikmigrations&lt;/a&gt;
&lt;/h2&gt;
&lt;p&gt;
Rikmigrations uses the same Up()/Down() pattern but with a slightly different API
interface that I liked better. Here, the attributes are set on the assembly level
instead of the class level. I liked the class attributes from Migrator.NET better,
but this works too. 
&lt;/p&gt;
&lt;div&gt;
&lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 1:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; RikMigrations;&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 2:&lt;/span&gt; [assembly:
Migration(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(BlogMigration1), 1)]&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 3:&lt;/span&gt; [assembly:
Migration(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(BlogMigration2), 2)]&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 4:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; Blog.Migrations&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 5:&lt;/span&gt; {&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 6:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; BlogMigration1
: IMigration&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 7:&lt;/span&gt; {&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 8:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Up(DbProvider
db)&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 9:&lt;/span&gt; {&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 10:&lt;/span&gt; Table
t = db.AddTable(&lt;span style="color: #006080"&gt;"Blog"&lt;/span&gt;);&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 11:&lt;/span&gt; t.AddColumn(&lt;span style="color: #006080"&gt;"ID"&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;)).PrimaryKey().AutoGenerate();&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 12:&lt;/span&gt; t.AddColumn(&lt;span style="color: #006080"&gt;"Name"&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;),
64);&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 13:&lt;/span&gt; t.Save();&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 14:&lt;/span&gt; }&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 15:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Down(DbProvider
db)&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 16:&lt;/span&gt; {&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 17:&lt;/span&gt; db.DropTable(&lt;span style="color: #006080"&gt;"Blog"&lt;/span&gt;);&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 18:&lt;/span&gt; }&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 19:&lt;/span&gt;&amp;nbsp; &lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 20:&lt;/span&gt; }&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 21:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; BlogMigration2
: IMigration&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 22:&lt;/span&gt; {&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 23:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Up(DbProvider
db)&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 24:&lt;/span&gt; {&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 25:&lt;/span&gt; Table
t = db.AlterTable(&lt;span style="color: #006080"&gt;"Blog"&lt;/span&gt;);&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 26:&lt;/span&gt; t.AddColumn(&lt;span style="color: #006080"&gt;"Description"&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;), &lt;span style="color: #0000ff"&gt;int&lt;/span&gt;.MaxValue);&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 27:&lt;/span&gt; t.Save();&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 28:&lt;/span&gt; }&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 29:&lt;/span&gt; &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; Down(DbProvider
db)&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 30:&lt;/span&gt; {&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 31:&lt;/span&gt; Table
t = db.AlterTable(&lt;span style="color: #006080"&gt;"Blog"&lt;/span&gt;);&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 32:&lt;/span&gt; t.DropColumn(&lt;span style="color: #006080"&gt;"Description"&lt;/span&gt;);&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 33:&lt;/span&gt; t.Save();&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 34:&lt;/span&gt; }&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 35:&lt;/span&gt; }&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 36:&lt;/span&gt; }&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
&amp;nbsp;
&lt;/p&gt;
&lt;p&gt;
It has some cool features like using generics to specify the data types:
&lt;/p&gt;
&lt;div&gt;
&lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 1:&lt;/span&gt; Table
t = db.AddTable(&lt;span style="color: #006080"&gt;"Blog"&lt;/span&gt;);&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 2:&lt;/span&gt; t.AddColumn&amp;lt;&lt;span style="color: #0000ff"&gt;int&lt;/span&gt;&amp;gt;(&lt;span style="color: #006080"&gt;"ID"&lt;/span&gt;);&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 3:&lt;/span&gt; t.AddColumn&amp;lt;&lt;span style="color: #0000ff"&gt;string&lt;/span&gt;&amp;gt;(&lt;span style="color: #006080"&gt;"Name"&lt;/span&gt;,
64);&lt;/pre&gt;
&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 4:&lt;/span&gt; t.Save();&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;br&gt;
and inserting default data into a table:
&lt;/p&gt;
&lt;div&gt;
&lt;div style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;pre style="border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, 'Courier New', courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #606060"&gt; 1:&lt;/span&gt; db.InsertDataInto(&lt;span style="color: #006080"&gt;"Table1"&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; {
ID = 1, Name = &lt;span style="color: #006080"&gt;"Hello World"&lt;/span&gt; }, &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;);&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;br&gt;
It looks like it’s also missing the feature to add an index, but from what I’ve glanced
at the code, it shouldn’t be that hard to implement (this might just come back to
haunt me…)
&lt;/p&gt;
&lt;p&gt;
The documentation isn’t much and what little there is seems to be pretty old, but
the code doesn’t look that hard to just figure out so I don’t think it will be much
of a problem.
&lt;/p&gt;
&lt;p&gt;
I didn’t get a chance to try this today but tomorrow I’m going to take it for a spin.
There’s a couple of others I’d like to try as well. Watch this space for more.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.henriksen.no/aggbug.ashx?id=dfec4619-c443-4bda-98a5-8ef6a803ca88" /&gt;</description>
      <comments>http://www.henriksen.no/CommentView,guid,dfec4619-c443-4bda-98a5-8ef6a803ca88.aspx</comments>
    <feedburner:origLink>http://www.henriksen.no/2009/02/11/DatabaseMigrationsInCode.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.henriksen.no/Trackback.aspx?guid=7058c88c-807a-403d-9c93-9e8df73a6f88</trackback:ping>
      <pingback:server>http://www.henriksen.no/pingback.aspx</pingback:server>
      <pingback:target>http://www.henriksen.no/PermaLink,guid,7058c88c-807a-403d-9c93-9e8df73a6f88.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.henriksen.no/CommentView,guid,7058c88c-807a-403d-9c93-9e8df73a6f88.aspx</wfw:comment>
      <wfw:commentRss>http://www.henriksen.no/SyndicationService.asmx/GetEntryCommentsRss?guid=7058c88c-807a-403d-9c93-9e8df73a6f88</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Last week I talked at <a href="http://www.nnug.no/Avdelinger/Stavanger/" target="_blank">NNUG
Stavanger</a> about the SOLID principles and after <a href="http://iridescence.no/post/Slides-From-my-TDD-Talk.aspx" target="_blank">Fredrik
had his TDD talk</a> I had a small talk about BDD. The slides I used are below, you
can download them from Slideshare as well. They are licensed under <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" target="_blank">Creative
Commons BY-NC-SA</a>. 
</p>
        <p>
Some slides from the SOLID presentations doesn’t show right in the Slideshare viewer
so if you find it interesting you might want to <a href="http://www.slideshare.net/glennhenriksen/solid/download" target="_blank">download
it</a>. 
</p>
        <p>
        </p>
        <div style="text-align: left; width: 425px" id="__ss_1011287">
          <a style="margin: 12px 0px 3px; display: block; font: 14px helvetica,arial,sans-serif; text-decoration: underline" title="Solid" href="http://www.slideshare.net/glennhenriksen/solid?type=presentation">Solid</a>
          <object style="margin:0px" width="425" height="355">
            <param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=solid-1234262598405987-3&amp;rel=0&amp;stripped_title=solid" />
            <param name="allowFullScreen" value="true" />
            <param name="allowScriptAccess" value="always" />
            <embed src="http://static.slideshare.net/swf/ssplayer2.swf?doc=solid-1234262598405987-3&amp;rel=0&amp;stripped_title=solid" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355">
            </embed>
          </object>
        </div>
        <p>
        </p>
        <p>
        </p>
        <div style="text-align: left; width: 425px" id="__ss_1005294">
          <a style="margin: 12px 0px 3px; display: block; font: 14px helvetica,arial,sans-serif; text-decoration: underline" title="BDD presentasjon fra Stavanger NNUG 5. februar" href="http://www.slideshare.net/glennhenriksen/bdd-presentasjon-fra-stavanger-nnug-5-februar?type=presentation">BDD</a>
          <object style="margin:0px" width="425" height="355">
            <param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=bdd-1234136699855353-2&amp;rel=0&amp;stripped_title=bdd-presentasjon-fra-stavanger-nnug-5-februar" />
            <param name="allowFullScreen" value="true" />
            <param name="allowScriptAccess" value="always" />
            <embed src="http://static.slideshare.net/swf/ssplayer2.swf?doc=bdd-1234136699855353-2&amp;rel=0&amp;stripped_title=bdd-presentasjon-fra-stavanger-nnug-5-februar" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355">
            </embed>
          </object>
        </div>
        <p>
        </p>
        <p>
          <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="license">
            <img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" alt="Creative Commons License" src="http://i.creativecommons.org/l/by-nc-sa/3.0/88x31.png" />
          </a>
          <br />
This work is licensed under a <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="license">Creative
Commons Attribution-Noncommercial-Share Alike 3.0 Unported License</a>.
</p>
        <img width="0" height="0" src="http://www.henriksen.no/aggbug.ashx?id=7058c88c-807a-403d-9c93-9e8df73a6f88" />
      </body>
      <title>Slides from my SOLID and BDD talk at NNUG</title>
      <guid isPermaLink="false">http://www.henriksen.no/PermaLink,guid,7058c88c-807a-403d-9c93-9e8df73a6f88.aspx</guid>
      <link>http://feedproxy.google.com/~r/GlennFHenriksen/~3/htuj2thGndU/SlidesFromMySOLIDAndBDDTalkAtNNUG.aspx</link>
      <pubDate>Wed, 11 Feb 2009 18:52:29 GMT</pubDate>
      <description>&lt;p&gt;
Last week I talked at &lt;a href="http://www.nnug.no/Avdelinger/Stavanger/" target="_blank"&gt;NNUG
Stavanger&lt;/a&gt; about the SOLID principles and after &lt;a href="http://iridescence.no/post/Slides-From-my-TDD-Talk.aspx" target="_blank"&gt;Fredrik
had his TDD talk&lt;/a&gt; I had a small talk about BDD. The slides I used are below, you
can download them from Slideshare as well. They are licensed under &lt;a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" target="_blank"&gt;Creative
Commons BY-NC-SA&lt;/a&gt;. 
&lt;/p&gt;
&lt;p&gt;
Some slides from the SOLID presentations doesn’t show right in the Slideshare viewer
so if you find it interesting you might want to &lt;a href="http://www.slideshare.net/glennhenriksen/solid/download" target="_blank"&gt;download
it&lt;/a&gt;. 
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;div style="text-align: left; width: 425px" id="__ss_1011287"&gt;&lt;a style="margin: 12px 0px 3px; display: block; font: 14px helvetica,arial,sans-serif; text-decoration: underline" title="Solid" href="http://www.slideshare.net/glennhenriksen/solid?type=presentation"&gt;Solid&lt;/a&gt;
&lt;object style="margin:0px" width="425" height="355"&gt;
&lt;param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=solid-1234262598405987-3&amp;amp;rel=0&amp;amp;stripped_title=solid" /&gt;
&lt;param name="allowFullScreen" value="true" /&gt;
&lt;param name="allowScriptAccess" value="always" /&gt;&lt;embed src="http://static.slideshare.net/swf/ssplayer2.swf?doc=solid-1234262598405987-3&amp;amp;rel=0&amp;amp;stripped_title=solid" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"&gt;&lt;/embed&gt;
&lt;/object&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;div style="text-align: left; width: 425px" id="__ss_1005294"&gt;&lt;a style="margin: 12px 0px 3px; display: block; font: 14px helvetica,arial,sans-serif; text-decoration: underline" title="BDD presentasjon fra Stavanger NNUG 5. februar" href="http://www.slideshare.net/glennhenriksen/bdd-presentasjon-fra-stavanger-nnug-5-februar?type=presentation"&gt;BDD&lt;/a&gt;
&lt;object style="margin:0px" width="425" height="355"&gt;
&lt;param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=bdd-1234136699855353-2&amp;amp;rel=0&amp;amp;stripped_title=bdd-presentasjon-fra-stavanger-nnug-5-februar" /&gt;
&lt;param name="allowFullScreen" value="true" /&gt;
&lt;param name="allowScriptAccess" value="always" /&gt;&lt;embed src="http://static.slideshare.net/swf/ssplayer2.swf?doc=bdd-1234136699855353-2&amp;amp;rel=0&amp;amp;stripped_title=bdd-presentasjon-fra-stavanger-nnug-5-februar" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"&gt;&lt;/embed&gt;
&lt;/object&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="license"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" alt="Creative Commons License" src="http://i.creativecommons.org/l/by-nc-sa/3.0/88x31.png"&gt;&lt;/a&gt;
&lt;br&gt;
This work is licensed under a &lt;a href="http://creativecommons.org/licenses/by-nc-sa/3.0/" rel="license"&gt;Creative
Commons Attribution-Noncommercial-Share Alike 3.0 Unported License&lt;/a&gt;.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.henriksen.no/aggbug.ashx?id=7058c88c-807a-403d-9c93-9e8df73a6f88" /&gt;</description>
      <comments>http://www.henriksen.no/CommentView,guid,7058c88c-807a-403d-9c93-9e8df73a6f88.aspx</comments>
    <feedburner:origLink>http://www.henriksen.no/2009/02/11/SlidesFromMySOLIDAndBDDTalkAtNNUG.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.henriksen.no/Trackback.aspx?guid=7d403c23-25fe-4a73-9080-2bc757ebd822</trackback:ping>
      <pingback:server>http://www.henriksen.no/pingback.aspx</pingback:server>
      <pingback:target>http://www.henriksen.no/PermaLink,guid,7d403c23-25fe-4a73-9080-2bc757ebd822.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.henriksen.no/CommentView,guid,7d403c23-25fe-4a73-9080-2bc757ebd822.aspx</wfw:comment>
      <wfw:commentRss>http://www.henriksen.no/SyndicationService.asmx/GetEntryCommentsRss?guid=7d403c23-25fe-4a73-9080-2bc757ebd822</wfw:commentRss>
      <slash:comments>8</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://www.henriksen.no/content/binary/GeekBeerStavanger4.marskl1900_B6E2/Guinness.png">
            <img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="Guinness" border="0" alt="Guinness" align="right" src="http://www.henriksen.no/content/binary/GeekBeerStavanger4.marskl1900_B6E2/Guinness_thumb.png" width="244" height="164" />
          </a> Vi
kopierer suksessen de har hatt i Oslo og arrangerer GeekBeer i Stavanger.
</p>
        <p>
          <font size="5">Onsdag 4. mars, kl 19:00 på Timbuktu</font>
        </p>
        <p>
Kommenter gjerne her hvis du har tenkt å bli med, ellers kan jeg kontaktes på glenn
krøllalfa henriksen punktum no eller på <a href="http://www.twitter.com/" target="_blank">Twitter</a> som <a href="http://www.twitter.com/henriksen">@henriksen</a>. 
</p>
        <p>
Det er ingen krav til deltakerene men det er en fordel at du er sånn passe interessert
i utvikling. Om det er i .NET, Java, PHP, Ruby eller noe annet er det samme. 
</p>
        <br clear="all" />
        <p>
          <a href="http://www.henriksen.no/content/binary/GeekBeerStavanger4.marskl1900_B6E2/image.png">
            <img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="image" border="0" alt="image" align="right" src="http://www.henriksen.no/content/binary/GeekBeerStavanger4.marskl1900_B6E2/image_thumb.png" width="244" height="186" />
          </a> Vi
organiserer, du står for din egen drikke.
</p>
        <p>
          <a href="http://www.facebook.com/event.php?eid=63333567224">GeekBeer er også på Facebook</a> så
du kan melde deg på der og!
</p>
        <img width="0" height="0" src="http://www.henriksen.no/aggbug.ashx?id=7d403c23-25fe-4a73-9080-2bc757ebd822" />
      </body>
      <title>GeekBeer Stavanger 4. mars, kl 19:00</title>
      <guid isPermaLink="false">http://www.henriksen.no/PermaLink,guid,7d403c23-25fe-4a73-9080-2bc757ebd822.aspx</guid>
      <link>http://feedproxy.google.com/~r/GlennFHenriksen/~3/0TllNKKpCpo/GeekBeerStavanger4MarsKl1900.aspx</link>
      <pubDate>Wed, 11 Feb 2009 12:00:22 GMT</pubDate>
      <description>&lt;p&gt;
&lt;a href="http://www.henriksen.no/content/binary/GeekBeerStavanger4.marskl1900_B6E2/Guinness.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="Guinness" border="0" alt="Guinness" align="right" src="http://www.henriksen.no/content/binary/GeekBeerStavanger4.marskl1900_B6E2/Guinness_thumb.png" width="244" height="164"&gt;&lt;/a&gt; Vi
kopierer suksessen de har hatt i Oslo og arrangerer GeekBeer i Stavanger.
&lt;/p&gt;
&lt;p&gt;
&lt;font size="5"&gt;Onsdag 4. mars, kl 19:00 på Timbuktu&lt;/font&gt;
&lt;/p&gt;
&lt;p&gt;
Kommenter gjerne her hvis du har tenkt å bli med, ellers kan jeg kontaktes på glenn
krøllalfa henriksen punktum no eller på &lt;a href="http://www.twitter.com/" target="_blank"&gt;Twitter&lt;/a&gt; som &lt;a href="http://www.twitter.com/henriksen"&gt;@henriksen&lt;/a&gt;. 
&lt;/p&gt;
&lt;p&gt;
Det er ingen krav til deltakerene men det er en fordel at du er sånn passe interessert
i utvikling. Om det er i .NET, Java, PHP, Ruby eller noe annet er det samme. 
&lt;/p&gt;
&lt;br clear="all"&gt;
&lt;p&gt;
&lt;a href="http://www.henriksen.no/content/binary/GeekBeerStavanger4.marskl1900_B6E2/image.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="image" border="0" alt="image" align="right" src="http://www.henriksen.no/content/binary/GeekBeerStavanger4.marskl1900_B6E2/image_thumb.png" width="244" height="186"&gt;&lt;/a&gt; Vi
organiserer, du står for din egen drikke.
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.facebook.com/event.php?eid=63333567224"&gt;GeekBeer er også på Facebook&lt;/a&gt; så
du kan melde deg på der og!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.henriksen.no/aggbug.ashx?id=7d403c23-25fe-4a73-9080-2bc757ebd822" /&gt;</description>
      <comments>http://www.henriksen.no/CommentView,guid,7d403c23-25fe-4a73-9080-2bc757ebd822.aspx</comments>
      <category>Conferences</category>
    <feedburner:origLink>http://www.henriksen.no/2009/02/11/GeekBeerStavanger4MarsKl1900.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.henriksen.no/Trackback.aspx?guid=9f6f5044-3bd1-4587-a08a-e681c475179f</trackback:ping>
      <pingback:server>http://www.henriksen.no/pingback.aspx</pingback:server>
      <pingback:target>http://www.henriksen.no/PermaLink,guid,9f6f5044-3bd1-4587-a08a-e681c475179f.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.henriksen.no/CommentView,guid,9f6f5044-3bd1-4587-a08a-e681c475179f.aspx</wfw:comment>
      <wfw:commentRss>http://www.henriksen.no/SyndicationService.asmx/GetEntryCommentsRss?guid=9f6f5044-3bd1-4587-a08a-e681c475179f</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://www.henriksen.no/content/binary/WhyNorwegianDevelopersConference2009isth_CFED/image.png">
            <img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="image" border="0" alt="image" align="right" src="http://www.henriksen.no/content/binary/WhyNorwegianDevelopersConference2009isth_CFED/image_thumb.png" width="299" height="92" />
          </a> If
you’re attending one conference this year, you should be in Oslo on the 17th through
19th of June, at the NDC 2009. The line-up is fantastic and I’ll challenge anyone
to show me a development conference with a better speaker line-up.
</p>
        <p>
Mary Poppendieck, Mike Cohn, Scott Hanselman, Michael Feathers, Robert C. Martin (uncle
Bob), Ted Neward and many more. And there’s even more on the way. This is the A-Team
of speakers!
</p>
        <p>
If you’re not a full time developer, but work more as a project manager, check out
the last day, the Norwegian Agile Day, a whole day dedicated to sessions on agile
software development, with, amongst others, Mary Poppendieck, an authority in lean
development and Mike Cohn, the founder of both the Agile Alliance and the Scrum Alliance.
</p>
        <p>
It doesn’t matter where you’re from, this is the conference to attend!
</p>
        <p>
Don’t miss it! 
</p>
        <img width="0" height="0" src="http://www.henriksen.no/aggbug.ashx?id=9f6f5044-3bd1-4587-a08a-e681c475179f" />
      </body>
      <title>Why Norwegian Developers Conference 2009 is the place to be</title>
      <guid isPermaLink="false">http://www.henriksen.no/PermaLink,guid,9f6f5044-3bd1-4587-a08a-e681c475179f.aspx</guid>
      <link>http://feedproxy.google.com/~r/GlennFHenriksen/~3/eWwNnyX89o4/WhyNorwegianDevelopersConference2009IsThePlaceToBe.aspx</link>
      <pubDate>Fri, 30 Jan 2009 12:46:00 GMT</pubDate>
      <description>&lt;p&gt;
&lt;a href="http://www.henriksen.no/content/binary/WhyNorwegianDevelopersConference2009isth_CFED/image.png"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; margin-left: 0px; border-left-width: 0px; margin-right: 0px" title="image" border="0" alt="image" align="right" src="http://www.henriksen.no/content/binary/WhyNorwegianDevelopersConference2009isth_CFED/image_thumb.png" width="299" height="92"&gt;&lt;/a&gt; If
you’re attending one conference this year, you should be in Oslo on the 17th through
19th of June, at the NDC 2009. The line-up is fantastic and I’ll challenge anyone
to show me a development conference with a better speaker line-up.
&lt;/p&gt;
&lt;p&gt;
Mary Poppendieck, Mike Cohn, Scott Hanselman, Michael Feathers, Robert C. Martin (uncle
Bob), Ted Neward and many more. And there’s even more on the way. This is the A-Team
of speakers!
&lt;/p&gt;
&lt;p&gt;
If you’re not a full time developer, but work more as a project manager, check out
the last day, the Norwegian Agile Day, a whole day dedicated to sessions on agile
software development, with, amongst others, Mary Poppendieck, an authority in lean
development and Mike Cohn, the founder of both the Agile Alliance and the Scrum Alliance.
&lt;/p&gt;
&lt;p&gt;
It doesn’t matter where you’re from, this is the conference to attend!
&lt;/p&gt;
&lt;p&gt;
Don’t miss it! 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.henriksen.no/aggbug.ashx?id=9f6f5044-3bd1-4587-a08a-e681c475179f" /&gt;</description>
      <comments>http://www.henriksen.no/CommentView,guid,9f6f5044-3bd1-4587-a08a-e681c475179f.aspx</comments>
      <category>Conferences</category>
      <category>Programming</category>
    <feedburner:origLink>http://www.henriksen.no/2009/01/30/WhyNorwegianDevelopersConference2009IsThePlaceToBe.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.henriksen.no/Trackback.aspx?guid=ab5293f0-4869-4bed-bf9f-604d59fea942</trackback:ping>
      <pingback:server>http://www.henriksen.no/pingback.aspx</pingback:server>
      <pingback:target>http://www.henriksen.no/PermaLink,guid,ab5293f0-4869-4bed-bf9f-604d59fea942.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.henriksen.no/CommentView,guid,ab5293f0-4869-4bed-bf9f-604d59fea942.aspx</wfw:comment>
      <wfw:commentRss>http://www.henriksen.no/SyndicationService.asmx/GetEntryCommentsRss?guid=ab5293f0-4869-4bed-bf9f-604d59fea942</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Regjeringen har i disse dager sluppet en <a href="http://www.reiseregningen.no/" target="_blank">løsning
for elektronisk reiseregning på nettet</a>. De har at på til sluppet den som fri programvare,
noe som egentlig bare skulle mangle med tanke på at det er skattepengene som har blitt
brukt. 
</p>
        <p>
Den er, ved første øyekast, ganske grei å bruke. Det er ikke alt jeg er like enig
i, men med tanke på det grusomme programmet vi bruker på jobben er dette en kjempeforbedring. 
</p>
        <p>
Men ved nærmere ettersyn er det en del ting som ikke er som de burde vært. De tekniske
løsningene er ikke så bra som de burde vært. Mange <a href="http://www.digi.no/php/ny_debatt.php?id=798423#innlegg_1" target="_blank">har
referert til disse</a> og jeg skal ikke gjenta de her, men det er én ting som virkelig
plager meg (utenom <a href="https://www.coderesort.com/p/reiseregningen/ticket/5" target="_blank">sikkerhetsproblemet</a>). 
</p>
        <p>
All forretningslogikk ligger i Adobe Flex klienten, den klienten som lastes ned og
kjøres på klienten. De har noen web services som kjører men det ser ut til at de ikke
gjør noe mer enn å lagre informasjon og å lage PDF-er. Hvorfor kunne ikke logikken
vært lagt på webserveren, eksponert gjennom en web service? Da kunne de laget et standard
XML Schema for å representere en reiseregning, tatt det i mot, gjort de nødvendige
beregningene og returnert det ferdige resultatet. Logikken for å regne ut en reiseregning
har ikke noe behov for å endre seg fra klient til klient. Ved å sentralisere dette
gjør man det mulig å lage mange forskjellige klienter som tar i mot data fra ett eller
annet sted, gir det til reiseregningen.no for å få det regnet ut etter de til enhver
tid gjeldene regler og få tilbake et resultat for så å gjøre hva man vil med det. 
</p>
        <p>
Det hadde gjort det mye, mye enklere å lage alternative UI-er eller å integrere en
reiseregning i et annet produkt eller arbeidsflyt. 
</p>
        <p>
Om ikke annet så hadde logikken vært implementert i C# og ikke i ActionScript, et
språk med mye mindre utbredelse enn C#...
</p>
        <img width="0" height="0" src="http://www.henriksen.no/aggbug.ashx?id=ab5293f0-4869-4bed-bf9f-604d59fea942" />
      </body>
      <title>Hvor reiseregningen.no virkelig feiler</title>
      <guid isPermaLink="false">http://www.henriksen.no/PermaLink,guid,ab5293f0-4869-4bed-bf9f-604d59fea942.aspx</guid>
      <link>http://feedproxy.google.com/~r/GlennFHenriksen/~3/ZZKEvLsT9_Q/HvorReiseregningennoVirkeligFeiler.aspx</link>
      <pubDate>Thu, 18 Dec 2008 00:30:19 GMT</pubDate>
      <description>&lt;p&gt;
Regjeringen har i disse dager sluppet en &lt;a href="http://www.reiseregningen.no/" target="_blank"&gt;løsning
for elektronisk reiseregning på nettet&lt;/a&gt;. De har at på til sluppet den som fri programvare,
noe som egentlig bare skulle mangle med tanke på at det er skattepengene som har blitt
brukt. 
&lt;/p&gt;
&lt;p&gt;
Den er, ved første øyekast, ganske grei å bruke. Det er ikke alt jeg er like enig
i, men med tanke på det grusomme programmet vi bruker på jobben er dette en kjempeforbedring. 
&lt;/p&gt;
&lt;p&gt;
Men ved nærmere ettersyn er det en del ting som ikke er som de burde vært. De tekniske
løsningene er ikke så bra som de burde vært. Mange &lt;a href="http://www.digi.no/php/ny_debatt.php?id=798423#innlegg_1" target="_blank"&gt;har
referert til disse&lt;/a&gt; og jeg skal ikke gjenta de her, men det er én ting som virkelig
plager meg (utenom &lt;a href="https://www.coderesort.com/p/reiseregningen/ticket/5" target="_blank"&gt;sikkerhetsproblemet&lt;/a&gt;). 
&lt;/p&gt;
&lt;p&gt;
All forretningslogikk ligger i Adobe Flex klienten, den klienten som lastes ned og
kjøres på klienten. De har noen web services som kjører men det ser ut til at de ikke
gjør noe mer enn å lagre informasjon og å lage PDF-er. Hvorfor kunne ikke logikken
vært lagt på webserveren, eksponert gjennom en web service? Da kunne de laget et standard
XML Schema for å representere en reiseregning, tatt det i mot, gjort de nødvendige
beregningene og returnert det ferdige resultatet. Logikken for å regne ut en reiseregning
har ikke noe behov for å endre seg fra klient til klient. Ved å sentralisere dette
gjør man det mulig å lage mange forskjellige klienter som tar i mot data fra ett eller
annet sted, gir det til reiseregningen.no for å få det regnet ut etter de til enhver
tid gjeldene regler og få tilbake et resultat for så å gjøre hva man vil med det. 
&lt;/p&gt;
&lt;p&gt;
Det hadde gjort det mye, mye enklere å lage alternative UI-er eller å integrere en
reiseregning i et annet produkt eller arbeidsflyt. 
&lt;/p&gt;
&lt;p&gt;
Om ikke annet så hadde logikken vært implementert i C# og ikke i ActionScript, et
språk med mye mindre utbredelse enn C#...
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.henriksen.no/aggbug.ashx?id=ab5293f0-4869-4bed-bf9f-604d59fea942" /&gt;</description>
      <comments>http://www.henriksen.no/CommentView,guid,ab5293f0-4869-4bed-bf9f-604d59fea942.aspx</comments>
    <feedburner:origLink>http://www.henriksen.no/2008/12/18/HvorReiseregningennoVirkeligFeiler.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.henriksen.no/Trackback.aspx?guid=6e236ec2-3a92-4954-a381-b90ba7953be0</trackback:ping>
      <pingback:server>http://www.henriksen.no/pingback.aspx</pingback:server>
      <pingback:target>http://www.henriksen.no/PermaLink,guid,6e236ec2-3a92-4954-a381-b90ba7953be0.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.henriksen.no/CommentView,guid,6e236ec2-3a92-4954-a381-b90ba7953be0.aspx</wfw:comment>
      <wfw:commentRss>http://www.henriksen.no/SyndicationService.asmx/GetEntryCommentsRss?guid=6e236ec2-3a92-4954-a381-b90ba7953be0</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="wlWriterHeaderFooter" style="float:right; margin:0px; padding:0px 0px 4px 8px;">
          <script type="text/javascript">digg_url = "http://www.henriksen.no/2008/11/25/UnitTestSharepointCodeWithoutSharepoint.aspx";digg_title = "Unit test Sharepoint code without Sharepoint";digg_bgcolor = "#FFFFFF";digg_skin = "normal";</script>
          <script src="http://digg.com/tools/diggthis.js" type="text/javascript">
          </script>
          <script type="text/javascript">digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;</script>
        </div>
        <p>
This is kinda cool: 
</p>
        <p>
Typemock are offering their new product for <a href="http://www.typemock.com/sharepointpage.php?utm_source=sp_bb&amp;utm_medium=blog_4sp&amp;utm_campaign=sp_bb">unit
testing SharePoint</a> called Isolator For SharePoint, for a special introduction
price. it is the only tool that allows you to <a href="http://blog.typemock.com/2008/11/newisolatorforsharepointtoolforunittest.html?utm_source=typeblog&amp;utm_medium=sp_bb&amp;utm_campaign=typeblog">unit
test SharePoint</a> without a SharePoint server. To learn more <a href="http://www.typemock.com/sharepointpage.php?utm_source=sp_bb&amp;utm_medium=blog_4sp&amp;utm_campaign=sp_bb">click
here</a>. 
</p>
        <p>
          <strong>The first 50 bloggers </strong>who blog this text in their blog and tell us
about it, will get a Full Isolator license, Free. for rules and info <a href="http://blog.typemock.com/2008/11/newisolatorforsharepointtoolforunittest.html">click
here</a>. 
</p>
        <p>
  
</p>
        <p>
Sweet! :)
</p>
        <img width="0" height="0" src="http://www.henriksen.no/aggbug.ashx?id=6e236ec2-3a92-4954-a381-b90ba7953be0" />
      </body>
      <title>Unit test Sharepoint code without Sharepoint</title>
      <guid isPermaLink="false">http://www.henriksen.no/PermaLink,guid,6e236ec2-3a92-4954-a381-b90ba7953be0.aspx</guid>
      <link>http://feedproxy.google.com/~r/GlennFHenriksen/~3/M0wX2fPeIog/UnitTestSharepointCodeWithoutSharepoint.aspx</link>
      <pubDate>Tue, 25 Nov 2008 21:05:15 GMT</pubDate>
      <description>&lt;div class="wlWriterHeaderFooter" style="float:right; margin:0px; padding:0px 0px 4px 8px;"&gt;&lt;script type="text/javascript"&gt;digg_url = "http://www.henriksen.no/2008/11/25/UnitTestSharepointCodeWithoutSharepoint.aspx";digg_title = "Unit test Sharepoint code without Sharepoint";digg_bgcolor = "#FFFFFF";digg_skin = "normal";&lt;/script&gt;&lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script type="text/javascript"&gt;digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;&lt;/script&gt;
&lt;/div&gt;
&lt;p&gt;
This is kinda cool: 
&lt;/p&gt;
&lt;p&gt;
Typemock are offering their new product for &lt;a href="http://www.typemock.com/sharepointpage.php?utm_source=sp_bb&amp;amp;utm_medium=blog_4sp&amp;amp;utm_campaign=sp_bb"&gt;unit
testing SharePoint&lt;/a&gt; called Isolator For SharePoint, for a special introduction
price. it is the only tool that allows you to &lt;a href="http://blog.typemock.com/2008/11/newisolatorforsharepointtoolforunittest.html?utm_source=typeblog&amp;amp;utm_medium=sp_bb&amp;amp;utm_campaign=typeblog"&gt;unit
test SharePoint&lt;/a&gt; without a SharePoint server. To learn more &lt;a href="http://www.typemock.com/sharepointpage.php?utm_source=sp_bb&amp;amp;utm_medium=blog_4sp&amp;amp;utm_campaign=sp_bb"&gt;click
here&lt;/a&gt;. 
&lt;p&gt;
&lt;strong&gt;The first 50 bloggers &lt;/strong&gt;who blog this text in their blog and tell us
about it, will get a Full Isolator license, Free. for rules and info &lt;a href="http://blog.typemock.com/2008/11/newisolatorforsharepointtoolforunittest.html"&gt;click
here&lt;/a&gt;. 
&lt;p&gt;
&amp;nbsp; 
&lt;p&gt;
Sweet! :)
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.henriksen.no/aggbug.ashx?id=6e236ec2-3a92-4954-a381-b90ba7953be0" /&gt;</description>
      <comments>http://www.henriksen.no/CommentView,guid,6e236ec2-3a92-4954-a381-b90ba7953be0.aspx</comments>
    <feedburner:origLink>http://www.henriksen.no/2008/11/25/UnitTestSharepointCodeWithoutSharepoint.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.henriksen.no/Trackback.aspx?guid=effef0d6-d240-4ea7-b8be-ce79a5cebd6a</trackback:ping>
      <pingback:server>http://www.henriksen.no/pingback.aspx</pingback:server>
      <pingback:target>http://www.henriksen.no/PermaLink,guid,effef0d6-d240-4ea7-b8be-ce79a5cebd6a.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.henriksen.no/CommentView,guid,effef0d6-d240-4ea7-b8be-ce79a5cebd6a.aspx</wfw:comment>
      <wfw:commentRss>http://www.henriksen.no/SyndicationService.asmx/GetEntryCommentsRss?guid=effef0d6-d240-4ea7-b8be-ce79a5cebd6a</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div class="wlWriterHeaderFooter" style="float:right; margin:0px; padding:0px 0px 4px 8px;">
          <script type="text/javascript">digg_url = "http://www.henriksen.no/2008/10/17/CodeCommentOfTheYear.aspx";digg_title = "Code comment of the year";digg_bgcolor = "#FFFFFF";digg_skin = "normal";</script>
          <script src="http://digg.com/tools/diggthis.js" type="text/javascript">
          </script>
          <script type="text/javascript">digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;</script>
        </div>
        <p>
I was looking at the source of a Twitter plugin to Windows Live Writer and found this
gem of a comment:
</p>
        <pre class="csharpcode">TwitterApi.UpdateStatus(Username, Password, status);
                
<span class="rem">//
Updating Twitter often happens so quickly that</span><span class="rem">// it doesn't
feel like enough time has passed for</span><span class="rem">// it to have worked.
So sleep for 250 millis to</span><span class="rem">// make the user feel like something
happened.</span> Thread.Sleep(250);</pre>
        <style type="text/css">.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
</style>
        <p>
        </p>
        <p>
        </p>
        <p>
Fantastic!
</p>
        <img width="0" height="0" src="http://www.henriksen.no/aggbug.ashx?id=effef0d6-d240-4ea7-b8be-ce79a5cebd6a" />
      </body>
      <title>Code comment of the year</title>
      <guid isPermaLink="false">http://www.henriksen.no/PermaLink,guid,effef0d6-d240-4ea7-b8be-ce79a5cebd6a.aspx</guid>
      <link>http://feedproxy.google.com/~r/GlennFHenriksen/~3/lqK6dc0SvkM/CodeCommentOfTheYear.aspx</link>
      <pubDate>Fri, 17 Oct 2008 08:10:13 GMT</pubDate>
      <description>&lt;div class="wlWriterHeaderFooter" style="float:right; margin:0px; padding:0px 0px 4px 8px;"&gt;&lt;script type="text/javascript"&gt;digg_url = "http://www.henriksen.no/2008/10/17/CodeCommentOfTheYear.aspx";digg_title = "Code comment of the year";digg_bgcolor = "#FFFFFF";digg_skin = "normal";&lt;/script&gt;&lt;script src="http://digg.com/tools/diggthis.js" type="text/javascript"&gt;&lt;/script&gt;&lt;script type="text/javascript"&gt;digg_url = undefined;digg_title = undefined;digg_bgcolor = undefined;digg_skin = undefined;&lt;/script&gt;
&lt;/div&gt;
&lt;p&gt;
I was looking at the source of a Twitter plugin to Windows Live Writer and found this
gem of a comment:
&lt;/p&gt;
&lt;pre class="csharpcode"&gt;TwitterApi.UpdateStatus(Username, Password, status);
                
&lt;span class="rem"&gt;//
Updating Twitter often happens so quickly that&lt;/span&gt; &lt;span class="rem"&gt;// it doesn't
feel like enough time has passed for&lt;/span&gt; &lt;span class="rem"&gt;// it to have worked.
So sleep for 250 millis to&lt;/span&gt; &lt;span class="rem"&gt;// make the user feel like something
happened.&lt;/span&gt; Thread.Sleep(250);&lt;/pre&gt;
&lt;style type="text/css"&gt;.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Fantastic!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.henriksen.no/aggbug.ashx?id=effef0d6-d240-4ea7-b8be-ce79a5cebd6a" /&gt;</description>
      <comments>http://www.henriksen.no/CommentView,guid,effef0d6-d240-4ea7-b8be-ce79a5cebd6a.aspx</comments>
    <feedburner:origLink>http://www.henriksen.no/2008/10/17/CodeCommentOfTheYear.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.henriksen.no/Trackback.aspx?guid=391dd8a7-0572-443f-b9f4-5f07f2080691</trackback:ping>
      <pingback:server>http://www.henriksen.no/pingback.aspx</pingback:server>
      <pingback:target>http://www.henriksen.no/PermaLink,guid,391dd8a7-0572-443f-b9f4-5f07f2080691.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.henriksen.no/CommentView,guid,391dd8a7-0572-443f-b9f4-5f07f2080691.aspx</wfw:comment>
      <wfw:commentRss>http://www.henriksen.no/SyndicationService.asmx/GetEntryCommentsRss?guid=391dd8a7-0572-443f-b9f4-5f07f2080691</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
        <p>
          <a href="http://www.henriksen.no/content/binary/MicrosoftApplicationInstallershortcuttoO_83C2/image.png">
            <img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" align="right" src="http://www.henriksen.no/content/binary/MicrosoftApplicationInstallershortcuttoO_83C2/image_thumb.png" width="328" height="193" />
          </a> Microsoft
has released a beta of the <a href="http://www.microsoft.com/web/channel/products/WebApplicationInstaller.aspx">Microsoft
Web Application Installer</a>, an installer that will present you some popular open
source web applications like Grafitti, DotNetNuke, WordPress, OSCommerce and more
(yes, PHP apps too!).
</p>
        <p>
It will check your machine for pre-requisites you’ll need, provide links for downloads,
configure IIS, allow you to enter basic configuration items and install everything. 
</p>
        <p>
Microsoft making it easier to install OpenSource? What’s the world coming too…? :) 
</p>
        <p>
          <a href="http://www.hanselman.com/blog/MicrosoftWebApplicationInstallerOpenSourceWebAppsDeliveredAndInstalled.aspx">Scott
Hanselman has more details</a> too
</p>
        <img width="0" height="0" src="http://www.henriksen.no/aggbug.ashx?id=391dd8a7-0572-443f-b9f4-5f07f2080691" />
      </body>
      <title>Microsoft Application Installer &amp;ndash; shortcut to Open Source on your web server</title>
      <guid isPermaLink="false">http://www.henriksen.no/PermaLink,guid,391dd8a7-0572-443f-b9f4-5f07f2080691.aspx</guid>
      <link>http://feedproxy.google.com/~r/GlennFHenriksen/~3/Nsce5UrEJyw/MicrosoftApplicationInstallerNdashShortcutToOpenSourceOnYourWebServer.aspx</link>
      <pubDate>Fri, 17 Oct 2008 07:22:14 GMT</pubDate>
      <description>&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.henriksen.no/content/binary/MicrosoftApplicationInstallershortcuttoO_83C2/image.png"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" align="right" src="http://www.henriksen.no/content/binary/MicrosoftApplicationInstallershortcuttoO_83C2/image_thumb.png" width="328" height="193"&gt;&lt;/a&gt; Microsoft
has released a beta of the &lt;a href="http://www.microsoft.com/web/channel/products/WebApplicationInstaller.aspx"&gt;Microsoft
Web Application Installer&lt;/a&gt;, an installer that will present you some popular open
source web applications like Grafitti, DotNetNuke, WordPress, OSCommerce and more
(yes, PHP apps too!).
&lt;/p&gt;
&lt;p&gt;
It will check your machine for pre-requisites you’ll need, provide links for downloads,
configure IIS, allow you to enter basic configuration items and install everything. 
&lt;/p&gt;
&lt;p&gt;
Microsoft making it easier to install OpenSource? What’s the world coming too…? :) 
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.hanselman.com/blog/MicrosoftWebApplicationInstallerOpenSourceWebAppsDeliveredAndInstalled.aspx"&gt;Scott
Hanselman has more details&lt;/a&gt; too
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.henriksen.no/aggbug.ashx?id=391dd8a7-0572-443f-b9f4-5f07f2080691" /&gt;</description>
      <comments>http://www.henriksen.no/CommentView,guid,391dd8a7-0572-443f-b9f4-5f07f2080691.aspx</comments>
    <feedburner:origLink>http://www.henriksen.no/2008/10/17/MicrosoftApplicationInstallerNdashShortcutToOpenSourceOnYourWebServer.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.henriksen.no/Trackback.aspx?guid=2338f432-1d32-4308-a3f8-0dda73d4934e</trackback:ping>
      <pingback:server>http://www.henriksen.no/pingback.aspx</pingback:server>
      <pingback:target>http://www.henriksen.no/PermaLink,guid,2338f432-1d32-4308-a3f8-0dda73d4934e.aspx</pingback:target>
      <dc:creator>Your DisplayName here!</dc:creator>
      <wfw:comment>http://www.henriksen.no/CommentView,guid,2338f432-1d32-4308-a3f8-0dda73d4934e.aspx</wfw:comment>
      <wfw:commentRss>http://www.henriksen.no/SyndicationService.asmx/GetEntryCommentsRss?guid=2338f432-1d32-4308-a3f8-0dda73d4934e</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://jquery.com/">
            <img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="JQuery" border="0" alt="JQuery" align="right" src="http://www.henriksen.no/content/binary/MicrosoftshippingopensourceJQueryasparto_150D9/image.png" width="219" height="57" />
          </a>
          <a href="http://weblogs.asp.net/scottgu/archive/2008/09/28/jquery-and-microsoft.aspx">Microsoft
have announced</a> that they will start shipping <a href="http://jquery.com/">JQuery</a> as
part of Visual Studio and offer full support for it. 
</p>
        <p>
They will be shipping the original, open-source, version under the original MIT license.
They will not be forking it or changing it and will contribute patches and changes
back to the JQuery project under regular patch review process.
</p>
        <p>
I think this is a fantastic idea! I’m glad people in MS sees that not everything has
to be invented there and that they are able to a) include open-source stuff in their
product and b) not take it over and make an incompatible version. 
</p>
        <p>
I believe that this way of doing things is symptomatic to the change in attitude I’ve
been seeing in the developer part of Microsoft for some time now, they are more open
and communicating better with the community. 
</p>
        <p>
Good things ahead.
</p>
        <img width="0" height="0" src="http://www.henriksen.no/aggbug.ashx?id=2338f432-1d32-4308-a3f8-0dda73d4934e" />
      </body>
      <title>Microsoft shipping open source JQuery as part of Visual Studio</title>
      <guid isPermaLink="false">http://www.henriksen.no/PermaLink,guid,2338f432-1d32-4308-a3f8-0dda73d4934e.aspx</guid>
      <link>http://feedproxy.google.com/~r/GlennFHenriksen/~3/6g60Tgx2Os0/MicrosoftShippingOpenSourceJQueryAsPartOfVisualStudio.aspx</link>
      <pubDate>Sun, 28 Sep 2008 21:57:15 GMT</pubDate>
      <description>&lt;p&gt;
&lt;a href="http://jquery.com/"&gt;&lt;img style="border-right-width: 0px; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="JQuery" border="0" alt="JQuery" align="right" src="http://www.henriksen.no/content/binary/MicrosoftshippingopensourceJQueryasparto_150D9/image.png" width="219" height="57"&gt;&lt;/a&gt; &lt;a href="http://weblogs.asp.net/scottgu/archive/2008/09/28/jquery-and-microsoft.aspx"&gt;Microsoft
have announced&lt;/a&gt; that they will start shipping &lt;a href="http://jquery.com/"&gt;JQuery&lt;/a&gt; as
part of Visual Studio and offer full support for it. 
&lt;/p&gt;
&lt;p&gt;
They will be shipping the original, open-source, version under the original MIT license.
They will not be forking it or changing it and will contribute patches and changes
back to the JQuery project under regular patch review process.
&lt;/p&gt;
&lt;p&gt;
I think this is a fantastic idea! I’m glad people in MS sees that not everything has
to be invented there and that they are able to a) include open-source stuff in their
product and b) not take it over and make an incompatible version. 
&lt;/p&gt;
&lt;p&gt;
I believe that this way of doing things is symptomatic to the change in attitude I’ve
been seeing in the developer part of Microsoft for some time now, they are more open
and communicating better with the community. 
&lt;/p&gt;
&lt;p&gt;
Good things ahead.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.henriksen.no/aggbug.ashx?id=2338f432-1d32-4308-a3f8-0dda73d4934e" /&gt;</description>
      <comments>http://www.henriksen.no/CommentView,guid,2338f432-1d32-4308-a3f8-0dda73d4934e.aspx</comments>
    <feedburner:origLink>http://www.henriksen.no/2008/09/28/MicrosoftShippingOpenSourceJQueryAsPartOfVisualStudio.aspx</feedburner:origLink></item>
  </channel>
</rss>

