Sha256: 714e08b36b18027f3c12a3647b4fddfed2e1d56bcaf4699b80df8ff8aa41f343

Contents?: true

Size: 785 Bytes

Versions: 3

Compression:

Stored size: 785 Bytes

Contents

class CreateRosettaTables < ActiveRecord::Migration[6.1]
  def change
    create_table :rosetta_locales do |t|
      t.string :name
      t.string :code
      t.boolean :published, default: false

      t.timestamps

      t.index :code, unique: true
    end

    create_table :rosetta_translation_keys do |t|
      t.text :value

      t.timestamps

      t.index :value, unique: true
    end

    create_table :rosetta_translations do |t|
      t.text :value
      t.references :locale, null: false
      t.references :translation_key, null: false

      t.timestamps

      t.index [ :locale_id, :translation_key_id ], unique: true
      t.foreign_key :rosetta_locales, column: :locale_id
      t.foreign_key :rosetta_translation_keys, column: :translation_key_id
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rosetta-rails-0.2.1 db/migrate/20240830123523_create_rosetta_tables.rb
rosetta-rails-0.2.0 db/migrate/20240830123523_create_rosetta_tables.rb
rosetta-rails-0.1.1 db/migrate/20240830123523_create_rosetta_tables.rb