diff --git a/lib/rails/generators/mobility/templates/create_string_translations.rb b/lib/rails/generators/mobility/templates/create_string_translations.rb index d79388b4..e88870b0 100644 --- a/lib/rails/generators/mobility/templates/create_string_translations.rb +++ b/lib/rails/generators/mobility/templates/create_string_translations.rb @@ -4,7 +4,7 @@ def change t.string :locale, null: false t.string :key, null: false t.string :value - t.references :translatable, polymorphic: true, index: false + t.references :translatable, polymorphic: true, index: false, null: false t.timestamps null: false end add_index :mobility_string_translations, [:translatable_id, :translatable_type, :locale, :key], unique: true, name: :index_mobility_string_translations_on_keys diff --git a/lib/rails/generators/mobility/templates/create_text_translations.rb b/lib/rails/generators/mobility/templates/create_text_translations.rb index aa168c93..4df3136e 100644 --- a/lib/rails/generators/mobility/templates/create_text_translations.rb +++ b/lib/rails/generators/mobility/templates/create_text_translations.rb @@ -4,7 +4,7 @@ def change t.string :locale, null: false t.string :key, null: false t.text :value - t.references :translatable, polymorphic: true, index: false + t.references :translatable, polymorphic: true, index: false, null: false t.timestamps null: false end add_index :mobility_text_translations, [:translatable_id, :translatable_type, :locale, :key], unique: true, name: :index_mobility_text_translations_on_keys