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

How we've migrated from globalize to hstore-translate

Description and use

Migrating from Globalize to hstore-translate simplifies the schema and improves performance.

Problem

The Rails application relied on the Globalize gem for translations, which caused performance and maintenance issues.

Outcome

The migration reduced the number of tables, simplified queries, and improved maintainability of the translation system.

Workflow

  • 1. Added the hstore-translate gem to the Gemfile and ran bundle install.
  • 2. Created a migration to add an hstore column (e.g., "translations") to each model that required translations.
  • 3. Updated the model to use hstore-translate instead of Globalize, specifying the translatable attributes.
  • 4. Wrote a data migration script to copy existing translations from Globalize tables into the new hstore column.
  • 5. Ran the data migration and verified data integrity.
  • 6. Removed Globalize-related tables and code, and updated tests to use the new translation mechanism.
  • 7. Deployed the changes to staging and monitored performance improvements.

Evidence

We migrated from Globalize to hstore-translate to simplify our schema and improve performance.

  • Record date: 2026-10-10T03:41:29.953Z