From a27dda62e008dc32f823a26bb0d4c193f6200ebc Mon Sep 17 00:00:00 2001 From: wvengen Date: Wed, 6 Nov 2013 10:54:20 +0100 Subject: [PATCH] copy migrations to default directory instead of trying to make it more easy to use --- config/application.rb | 3 --- ...95325_create_pages.foodsoft_wiki_engine.rb | 24 +++++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 db/migrate/20131106095325_create_pages.foodsoft_wiki_engine.rb diff --git a/config/application.rb b/config/application.rb index 4f0f199b..2d8cf3ef 100644 --- a/config/application.rb +++ b/config/application.rb @@ -63,8 +63,5 @@ module Foodsoft # It would be nice not to enable database connection when precompiling assets, # but i18n-js requires initialization, that's why it's on. config.assets.initialize_on_precompile = true - - # Include engine migrations. - http://stackoverflow.com/a/8364459/2866660 - config.paths['db/migrate'] += Rails.application.railties.engines.map{|e| e.paths['db/migrate'].existent}.flatten end end diff --git a/db/migrate/20131106095325_create_pages.foodsoft_wiki_engine.rb b/db/migrate/20131106095325_create_pages.foodsoft_wiki_engine.rb new file mode 100644 index 00000000..dc8cb3bc --- /dev/null +++ b/db/migrate/20131106095325_create_pages.foodsoft_wiki_engine.rb @@ -0,0 +1,24 @@ +# This migration comes from foodsoft_wiki_engine (originally 20090325175756) +class CreatePages < ActiveRecord::Migration + def self.up + create_table :pages do |t| + t.string :title + t.text :body + t.string :permalink + t.integer :lock_version, :default => 0 + t.integer :updated_by + t.integer :redirect + t.integer :parent_id + + t.timestamps + end + add_index :pages, :title + add_index :pages, :permalink + Page.create_versioned_table # Automaticly creates pages_versions table + end + + def self.down + drop_table :pages + Page.drop_versioned_table + end +end