Skip to content

Commit

Permalink
create translation tables
Browse files Browse the repository at this point in the history
  • Loading branch information
oriolgual committed Jan 23, 2012
1 parent cf518ee commit 7026cc6
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 1 deletion.
29 changes: 29 additions & 0 deletions db/migrate/20120123122809_create_globalize_tables.rb
@@ -0,0 +1,29 @@
class CreateGlobalizeTables < ActiveRecord::Migration
def up
Category.create_translation_table!({
name: :string,
}, {
migrate_data: true
})

Illustration.create_translation_table!({
name: :string,
description: :text
}, {
migrate_data: true
})

Video.create_translation_table!({
name: :string,
description: :text
}, {
migrate_data: true
})
end

def down
Category.drop_translation_table!
Illustration.drop_translation_table!
Video.drop_translation_table!
end
end
34 changes: 33 additions & 1 deletion db/schema.rb
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20111206190441) do
ActiveRecord::Schema.define(:version => 20120123122809) do

create_table "categories", :force => true do |t|
t.string "name"
Expand All @@ -24,6 +24,27 @@
add_index "categories", ["name"], :name => "index_categories_on_name"
add_index "categories", ["slug"], :name => "index_categories_on_slug"

create_table "category_translations", :force => true do |t|
t.integer "category_id"
t.string "locale"
t.string "name"
t.datetime "created_at"
t.datetime "updated_at"
end

add_index "category_translations", ["category_id"], :name => "index_category_translations_on_category_id"

create_table "illustration_translations", :force => true do |t|
t.integer "illustration_id"
t.string "locale"
t.string "name"
t.text "description"
t.datetime "created_at"
t.datetime "updated_at"
end

add_index "illustration_translations", ["illustration_id"], :name => "index_b0c98806d31be981f03b71bdd325c9417e68cd00"

create_table "illustrations", :force => true do |t|
t.string "name"
t.text "description"
Expand All @@ -37,6 +58,17 @@

add_index "illustrations", ["slug"], :name => "index_illustrations_on_slug", :unique => true

create_table "video_translations", :force => true do |t|
t.integer "video_id"
t.string "locale"
t.string "name"
t.text "description"
t.datetime "created_at"
t.datetime "updated_at"
end

add_index "video_translations", ["video_id"], :name => "index_video_translations_on_video_id"

create_table "videos", :force => true do |t|
t.string "name"
t.text "description"
Expand Down

0 comments on commit 7026cc6

Please sign in to comment.