Class: CreateActiveWebhookTables

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/templates/20210618023338_create_active_webhook_tables.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/generators/templates/20210618023338_create_active_webhook_tables.rb', line 4

def change
  create_table :active_webhook_subscriptions do |t|
    t.references :topic, class: :active_webhook_topic
    t.text :callback_url
    t.text :shared_secret
    t.datetime :disabled_at
    t.string :disabled_reason

    t.timestamps
  end

  create_table :active_webhook_topics do |t|
    t.string :key
    t.string :version
    t.datetime :disabled_at
    t.string :disabled_reason

    t.timestamps
  end

  create_table :active_webhook_error_logs do |t|
    t.references :subscription, class: :active_webhook_subscription
    t.string :job_id

    t.timestamps
  end
end