Sha256: a3a461209d3bf4187f14aadfbc081876af62424357aa35daa093d00dafbf38d9

Contents?: true

Size: 1.17 KB

Versions: 1

Compression:

Stored size: 1.17 KB

Contents

# frozen_string_literal: true

class CreateSpinaBlogTranslations < ActiveRecord::Migration[7.0]
  def change
    create_table :spina_blog_post_translations do |t|
      t.string :title
      t.text :excerpt
      t.text :content
      t.string :seo_title
      t.text :description

      t.string :locale, null: false
      t.references :spina_blog_post, null: false, foreign_key: true, index: false

      t.timestamps null: false
    end

    add_index :spina_blog_post_translations, :locale, name: :spina_blog_post_translations_on_locale
    add_index :spina_blog_post_translations, [:spina_blog_post_id, :locale], unique: true, name: :spina_blog_post_translations_on_locale_and_id

    create_table :spina_blog_category_translations do |t|
      t.string :name

      t.string :locale, null: false
      t.references :spina_blog_category, null: false, foreign_key: true, index: false

      t.timestamps null: false
    end

    add_index :spina_blog_category_translations, :locale, name: :spina_blog_category_translations_on_locale
    add_index :spina_blog_category_translations, [:spina_blog_category_id, :locale], unique: true, name: :spina_blog_category_translations_on_locale_and_id
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
spina-admin-conferences-blog-0.3.1 db/migrate/7_create_spina_blog_translations.rb