rails/actionmailbox/db/migrate/20180917164000_create_actio...

20 lines
606 B
Ruby
Raw Normal View History

class CreateActionMailboxTables < ActiveRecord::Migration[6.0]
2018-09-18 07:55:07 +08:00
def change
create_table :action_mailbox_inbound_emails, id: primary_key_type do |t|
2018-09-18 07:55:07 +08:00
t.integer :status, default: 0, null: false
t.string :message_id, null: false
t.string :message_checksum, null: false
2018-09-18 07:55:07 +08:00
t.timestamps
t.index [ :message_id, :message_checksum ], name: "index_action_mailbox_inbound_emails_uniqueness", unique: true
2018-09-18 07:55:07 +08:00
end
end
private
def primary_key_type
config = Rails.configuration.generators
config.options[config.orm][:primary_key_type] || :primary_key
end
2018-09-18 07:55:07 +08:00
end