]> git.openstreetmap.org Git - rails.git/blob - vendor/plugins/globalize2/generators/templates/db_backend_migration.rb
Localisation updates from http://translatewiki.net
[rails.git] / vendor / plugins / globalize2 / generators / templates / db_backend_migration.rb
1 class ActsAsTaggableMigration < ActiveRecord::Migration
2   def self.up
3     create_table :globalize_translations do |t|
4       t.string :locale, :null => false
5       t.string :key, :null => false
6       t.string :translation
7       t.timestamps
8     end
9
10 # TODO: FINISH DOING MIGRATION -- stopped in the middle
11     
12     create_table :globalize_translations_map do |t|
13       t.string  :key, :null => false
14       t.integer :translation_id, :null => false
15     end
16     
17     add_index :taggings, :tag_id
18     add_index :taggings, [:taggable_id, :taggable_type]
19   end
20   
21   def self.down
22     drop_table :globalize_translations
23     drop_table :tags
24   end
25 end