<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>db/migrate/20091021024908_modify_text_types.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff></diff>
      <filename>db/production.db.sqlite3</filename>
    </modified>
    <modified>
      <diff>@@ -1,17 +1,34 @@
+require 'rake'
+
+desc &quot;This task will perform necessary upgrades to your Instiki installation&quot;
 task :upgrade_instiki =&gt; :environment do
-  RAILS_ENV = 'production' unless ENV['RAILS_ENV']
-  puts &quot;Upgrading Instiki in #{RAILS_ENV} environment.&quot;
+  ENV['RAILS_ENV'] ||= 'production'
+  puts &quot;Upgrading Instiki in #{ENV['RAILS_ENV']} environment.&quot;
+
+  InstikiUpgrade.migrate_db
+  InstikiUpgrade.move_uploaded_files
+end
+
+class InstikiUpgrade
 
-  Web.all.each do |web|
-    public_path = Rails.root.join(&quot;public&quot;, web.address)
-    if public_path.exist?
-      webs_path = Rails.root.join(&quot;webs&quot;, web.address)
-      if webs_path.exist?
-        puts &quot;Warning! The directory #{webs_path} already exists. Skipping.&quot;
-      else
-        public_path.rename(webs_path)
-        puts &quot;Moved #{public_path} to #{webs_path}&quot;
+  def self.migrate_db
+    ActiveRecord::Base.establish_connection ENV['RAILS_ENV']
+    Rake::Task[&quot;db:migrate&quot;].invoke
+  end
+
+  def self.move_uploaded_files
+    Web.all.each do |web|
+      public_path = Rails.root.join(&quot;public&quot;, web.address)
+      if public_path.exist?
+        webs_path = Rails.root.join(&quot;webs&quot;, web.address)
+        if webs_path.exist?
+          puts &quot;Warning! The directory #{webs_path} already exists. Skipping.&quot;
+        else
+          public_path.rename(webs_path)
+          puts &quot;Moved #{public_path} to #{webs_path}&quot;
+        end
       end
     end
   end
-end
+
+end
\ No newline at end of file</diff>
      <filename>lib/tasks/upgrade_instiki.rake</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5df150425573d43aa96caf4912c3af5bb144dab0</id>
    </parent>
  </parents>
  <author>
    <name>Jacques Distler</name>
    <email>distler@golem.ph.utexas.edu</email>
  </author>
  <url>http://github.com/parasew/instiki/commit/97a35e280b4e27e5508d79dae93ae1a94c8183be</url>
  <id>97a35e280b4e27e5508d79dae93ae1a94c8183be</id>
  <committed-date>2009-10-20T22:42:48-07:00</committed-date>
  <authored-date>2009-10-20T22:42:48-07:00</authored-date>
  <message>DB Migration

  % rake upgrade_instiki

fixes some potential problems in the database column types.

Revision content can now be up to 16MB.
Under MySQL, the previous limit was 64KB.

Page names can now be up to 255 bytes.
Under MySQL, the previous limit was 60 bytes.

Additional CSS styles can now be up to 64KB.
Under MySQL, the previous limit was 255 bytes.

Thanks to Andrew Stacey for reporting these.</message>
  <tree>b3cf9c4ff7cb556ce90dd6d1ee082cfe4fb5b2cd</tree>
  <committer>
    <name>Jacques Distler</name>
    <email>distler@golem.ph.utexas.edu</email>
  </committer>
</commit>
