diff --git a/db/migrate/008_add_comatose_support.rb b/db/migrate/008_add_comatose_support.rb new file mode 100644 index 0000000..a88309d --- /dev/null +++ b/db/migrate/008_add_comatose_support.rb @@ -0,0 +1,36 @@ +module Comatose + class Page < ActiveRecord::Base + set_table_name 'comatose_pages' + acts_as_versioned :if_changed => [:title, :slug, :keywords, :body] + end +end + +class AddComatoseSupport < ActiveRecord::Migration + + # Schema for Comatose version 0.7+ + def self.up + create_table :comatose_pages do |t| + t.column "parent_id", :integer + t.column "full_path", :text, :default => '' + t.column "title", :string, :limit => 255 + t.column "slug", :string, :limit => 255 + t.column "keywords", :string, :limit => 255 + t.column "body", :text + t.column "filter_type", :string, :limit => 25, :default => "Textile" + t.column "author", :string, :limit => 255 + t.column "position", :integer, :default => 0 + t.column "version", :integer + t.column "updated_on", :datetime + t.column "created_on", :datetime + end + Comatose::Page.create_versioned_table + puts "Creating the default 'Home Page'..." + Comatose::Page.create( :title=>'Home Page', :body=>"h1. Welcome\n\nYour content goes here...", :author=>'System' ) + end + + def self.down + Comatose::Page.drop_versioned_table + drop_table :comatose_pages + end + +end diff --git a/db/migrate/009_add_comatose_support.rb b/db/migrate/009_add_comatose_support.rb deleted file mode 100644 index a88309d..0000000 --- a/db/migrate/009_add_comatose_support.rb +++ /dev/null @@ -1,36 +0,0 @@ -module Comatose - class Page < ActiveRecord::Base - set_table_name 'comatose_pages' - acts_as_versioned :if_changed => [:title, :slug, :keywords, :body] - end -end - -class AddComatoseSupport < ActiveRecord::Migration - - # Schema for Comatose version 0.7+ - def self.up - create_table :comatose_pages do |t| - t.column "parent_id", :integer - t.column "full_path", :text, :default => '' - t.column "title", :string, :limit => 255 - t.column "slug", :string, :limit => 255 - t.column "keywords", :string, :limit => 255 - t.column "body", :text - t.column "filter_type", :string, :limit => 25, :default => "Textile" - t.column "author", :string, :limit => 255 - t.column "position", :integer, :default => 0 - t.column "version", :integer - t.column "updated_on", :datetime - t.column "created_on", :datetime - end - Comatose::Page.create_versioned_table - puts "Creating the default 'Home Page'..." - Comatose::Page.create( :title=>'Home Page', :body=>"h1. Welcome\n\nYour content goes here...", :author=>'System' ) - end - - def self.down - Comatose::Page.drop_versioned_table - drop_table :comatose_pages - end - -end -- libgit2 0.21.2