Sha256: 4a5b55ef36245f1b0bc0a81b5a3aec95160eee0ea5320c97ba345873118c1031

Contents?: true

Size: 1.18 KB

Versions: 21

Compression:

Stored size: 1.18 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: ::Time.utc(1970)
      t.datetime :closed_at,        null: false, default: ::Time.utc(3000)
      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

21 entries across 21 versions & 1 rubygems

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