Remove obsolete model usage

We'd rather keep the table so future data migrations work smoothly, so
we change the migration in order to create the translation table without
using models.
This commit is contained in:
Javi Martín
2018-11-16 11:52:35 +01:00
parent 1a5b73a0bd
commit 4a7f479d21
2 changed files with 10 additions and 16 deletions

View File

@@ -1,15 +1,12 @@
class AddTranslateMilestones < ActiveRecord::Migration class AddTranslateMilestones < ActiveRecord::Migration
def self.up def change
Budget::Investment::Milestone.create_translation_table!( create_table :budget_investment_milestone_translations do |t|
{ t.integer :budget_investment_milestone_id, null: false
title: :string, t.string :locale, null: false
description: :text t.string :title
}, t.text :description
{ migrate_data: true }
)
end
def self.down t.timestamps null: false
Budget::Investment::Milestone.drop_translation_table! end
end end
end end

View File

@@ -163,15 +163,12 @@ ActiveRecord::Schema.define(version: 20181016204729) do
create_table "budget_investment_milestone_translations", force: :cascade do |t| create_table "budget_investment_milestone_translations", force: :cascade do |t|
t.integer "budget_investment_milestone_id", null: false t.integer "budget_investment_milestone_id", null: false
t.string "locale", null: false t.string "locale", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "title" t.string "title"
t.text "description" t.text "description"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
end end
add_index "budget_investment_milestone_translations", ["budget_investment_milestone_id"], name: "index_6770e7675fe296cf87aa0fd90492c141b5269e0b", using: :btree
add_index "budget_investment_milestone_translations", ["locale"], name: "index_budget_investment_milestone_translations_on_locale", using: :btree
create_table "budget_investment_milestones", force: :cascade do |t| create_table "budget_investment_milestones", force: :cascade do |t|
t.integer "investment_id" t.integer "investment_id"
t.string "title", limit: 80 t.string "title", limit: 80