Sha256: ac94d91083c5cf339625cefe1c90a1d6b2354046a66e02409a69347945cac8b5

Contents?: true

Size: 907 Bytes

Versions: 18

Compression:

Stored size: 907 Bytes

Contents

#namespace :dusen do
#
#  desc 'Creates a MyISAM table "search_texts" for fast Dusen searches'
#  task :create_search_text do
#    generator = File.exists?('script/generate') ? 'script/generate' : 'rails generate'
#    output = `#{generator} migration CreateSearchText`
#    output =~ %r{(db/migrate/.+?\.rb)} or raise "Could not create migration: #{output}"
#    path = $1
#    File.open(path, 'w') do |file|
#      file.write(
#"
#class CreateSearchText < ActiveRecord::Migration
#  def up
#    create_table :search_texts, :options => 'ENGINE=MyISAM' do |t|
#      t.integer :model_id
#      t.string  :model_type
#      t.text    :words
#    end
#    add_index :search_texts, [:model_type, :model_id] # for deletion
#    execute 'CREATE FULLTEXT INDEX fulltext_index_body ON search_texts (words)' # for search
#  end
#  def down
#    drop_table :search_texts
#  end
#end
#"
#    )
#    end
#  end
#
#end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
dusen-0.6.1 lib/dusen/tasks.rb
dusen-0.6.0 lib/dusen/tasks.rb
dusen-0.5.3 lib/dusen/tasks.rb
dusen-0.5.2 lib/dusen/tasks.rb
dusen-0.5.1 lib/dusen/tasks.rb
dusen-0.5 lib/dusen/tasks.rb
dusen-0.4.11 lib/dusen/tasks.rb
dusen-0.4.10 lib/dusen/tasks.rb
dusen-0.4.9 lib/dusen/tasks.rb
dusen-0.4.8 lib/dusen/tasks.rb
dusen-0.4.6 lib/dusen/tasks.rb
dusen-0.4.5 lib/dusen/tasks.rb
dusen-0.4.4 lib/dusen/tasks.rb
dusen-0.4.3 lib/dusen/tasks.rb
dusen-0.4.2 lib/dusen/tasks.rb
dusen-0.4.1 lib/dusen/tasks.rb
dusen-0.4.0 lib/dusen/tasks.rb
dusen-0.3.0 lib/dusen/tasks.rb