Sha256: a2f562a2b3eaf4a7611c8a17a77f85856450cbf2136088731f77c5380423edcf

Contents?: true

Size: 978 Bytes

Versions: 1

Compression:

Stored size: 978 Bytes

Contents

class CreateUnidomLocatings < ActiveRecord::Migration

  def change

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

      t.references :location, type: :uuid, null: false
      t.references :located,  type: :uuid, null: false,
        polymorphic: { null: false, default: '', limit: 200 }
      t.references :locator,  type: :uuid, null: false,
        polymorphic: { null: false, default: '', limit: 200 }

      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_locatings, :location_id
    add_index :unidom_locatings, :located_id
    add_index :unidom_locatings, :locator_id

  end

end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
unidom-geo-2.0 db/migrate/20010402000000_create_unidom_locatings.rb