Class: CreatePublishedMessages

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/aws_sqs_moniter/templates/create_published_messages_migration.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/generators/aws_sqs_moniter/templates/create_published_messages_migration.rb', line 2

def change
  create_table :published_messages, id: :uuid do |t|
    t.timestamps

    t.string :topic, null: false
    t.string :message, null: false
    t.string :response
    t.string :sqs_id, null: false, index:  { unique: true }
    t.string   :message_id, null: false, index: true
   
    t.integer :attempts, null: false, default: 0
    t.datetime :attempted_at

    t.string :published_by
    t.datetime :published_at

    t.index :published_by
    t.index :published_at
  end
end