Skip to content

Migrate existing values for column to default locale #16

@sergio-rivas

Description

@sergio-rivas

I was wondering how to migrate existing data to the jsonb?

My existing schema for an application as setup with title and content However, after a decision to make the content available internationally, we decided to incorporate a translation gem.

Here is the result:

    t.string "title"
    t.text "content"
    t.jsonb "title_translations"
    t.jsonb "content_translations"

The problem here is that the values originally stored in title are no longer accessible. I can only access them when I comment out the translates :title, :content line at the top of the model, which means I can't do it via simple script.

I think one simple solution to this would be to give users of the gem the ability to turn the translation on/off similar to how easy you made it to do i18n fallbacks on/off. That way at least users can write a simple script to migrate existing values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions