Sha256: 2f2b2f019bfc490e3f53a93bc0e4cd6cec7b18714513fb40a01de56a69bad9bf

Contents?: true

Size: 1.19 KB

Versions: 2

Compression:

Stored size: 1.19 KB

Contents

class CreateUnidomContactSubscriptions < ActiveRecord::Migration

  def change

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

      t.references :contact,    type: :uuid, null: false,
        polymorphic: { null: false, default: '', limit: 200 }
      t.references :subscriber, type: :uuid, null: false,
        polymorphic: { null: false, default: '', limit: 200 }

      t.string  :name,     null: false, default: '', limit: 32
      t.text    :description

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

      t.integer :grade,    null: false, default: 0
      t.integer :priority, null: false, default: 0

      t.column   :state, 'char(1)', null: false, default: 'C'
      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_contact_subscriptions, :contact_id
    add_index :unidom_contact_subscriptions, :subscriber_id

  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
unidom-contact-2.0 db/migrate/20010301000000_create_unidom_contact_subscriptions.rb
unidom-contact-1.4.6 db/migrate/20010301000000_create_unidom_contact_subscriptions.rb