code_junkie

Rails Schema creation problem

Nov 13th, 2011
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. class CreateNotes < ActiveRecord::Migration
  2. def self.up
  3. create_table(:notes, :options => 'ENGINE=MyISAM') do |t|
  4. t.string :title
  5. t.text :body
  6.  
  7. t.timestamps
  8. end
  9.  
  10. execute "alter table notes ADD FULLTEXT(title, body)"
  11.  
  12. end
  13.  
  14. create_table "notes", :force => true do |t|
  15. t.string "title"
  16. t.text "body"
  17. t.datetime "created_at"
  18. t.datetime "updated_at"
  19. end
  20.  
  21. add_index "notes", ["title", "body"], :name => "title"
  22.  
  23. # Use SQL instead of Active Record's schema dumper when creating the test database.
  24. # This is necessary if your schema can't be completely dumped by the schema dumper,
  25. # like if you have constraints or database-specific column types
  26. config.active_record.schema_format = :sql
  27.  
  28. config.active_record.schema_format = :sql
  29.  
  30. rake db:structure:dump
Add Comment
Please, Sign In to add comment