2018-12-30 09:04:17 +08:00
|
|
|
class CreateActionMailboxTables < ActiveRecord::Migration[6.0]
|
2018-09-18 07:55:07 +08:00
|
|
|
def change
|
2023-05-04 23:19:36 +08:00
|
|
|
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
|
2019-01-18 01:13:40 +08:00
|
|
|
t.string :message_id, null: false
|
|
|
|
t.string :message_checksum, null: false
|
2018-09-18 07:55:07 +08:00
|
|
|
|
2019-01-25 21:01:07 +08:00
|
|
|
t.timestamps
|
2019-01-18 01:13:40 +08:00
|
|
|
|
2019-01-18 04:14:45 +08:00
|
|
|
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
|
2023-05-04 23:19:36 +08:00
|
|
|
|
|
|
|
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
|