Sha256: 982fa1161278f3a7f85caf3864fa9c20fe5039249595b4c7a3281c483c698eb1

Contents?: true

Size: 920 Bytes

Versions: 1

Compression:

Stored size: 920 Bytes

Contents

class CreateUnidomCategorizings < ActiveRecord::Migration[6.0]

  def change

    create_table :unidom_categorizings, id: :uuid do |t|

      t.references :category,    type: :uuid, null: false,
        foreign_key: false
      t.references :categorized, type: :uuid, null: false,
        polymorphic: { type: :uuid, null: false }

      t.boolean :elemental, null: false, default: false

      t.column   :state, 'char(1)', null: false, default: Unidom::Common::STATE
      t.datetime :opened_at,        null: false, default: Unidom::Common::OPENED_AT
      t.datetime :closed_at,        null: false, default: Unidom::Common::CLOSED_AT
      t.boolean  :defunct,          null: false, default: false
      t.jsonb    :notation,         null: false, default: {}

      t.timestamps null: false

    end

    #add_index :unidom_categorizings, :category_id
    add_index :unidom_categorizings, :categorized_id

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
unidom-category-2.0.1 db/migrate/20000304000000_create_unidom_categorizings.rb