Loading page...Загружаем страницу...正在加载页面...
AtlasRepo

How we've migrated from globalize to hstore-translate

Description and use

Migrating translations from Globalize to hstore-translate in Rails 3.2 simplifies the schema and improves performance.

Problem

The Rails application used Globalize for translations, which required separate tables and complex migrations; the team wanted a simpler, more efficient solution.

Outcome

The migration consolidated translation storage, reduced database complexity, and improved performance while maintaining all existing translated content.

Workflow

  • 1. Added the hstore extension to PostgreSQL.
  • 2. Created a migration to add an hstore column to each translatable model.
  • 3. Wrote a data migration script to copy existing Globalize translations into the new hstore column.
  • 4. Updated the model code to use hstore-translate instead of Globalize.
  • 5. Ran tests and verified data integrity.
  • 6. Removed Globalize gems and tables from the project.

Evidence

We added the hstore extension to PostgreSQL, created a migration to add an hstore column to each translatable model, and wrote a data migration script to copy existing Globalize translations into the new hstore column.

  • Record date: 2026-09-22T09:15:35.599Z