Class: CreateAdyenNotifications

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/adyen/templates/notification_migration.rb

Class Method Summary collapse

Class Method Details

.downObject



26
27
28
# File 'lib/adyen/templates/notification_migration.rb', line 26

def self.down
  drop_table :adyen_notifications
end

.upObject



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/adyen/templates/notification_migration.rb', line 4

def self.up
  create_table :adyen_notifications do |t|
    t.boolean  :live,                  :null => false, :default => false
    t.string   :event_code,            :null => false, :limit => 40
    t.string   :psp_reference,         :null => false, :limit => 50
    t.string   :original_reference,    :null => true
    t.string   :merchant_reference,    :null => false
    t.string   :merchant_account_code, :null => false
    t.datetime :event_date,            :null => false
    t.boolean  :success,               :null => false, :default => false
    t.string   :payment_method,        :null => true
    t.string   :operations,            :null => true
    t.text     :reason,                :null => true
    t.string   :currency,              :null => true, :limit => 3
    t.integer  :value,                 :null => true
    t.boolean  :processed,             :null => false, :default => false
    t.timestamps
  end
   
  add_index :adyen_notifications, [:merchant_account_code, :psp_reference, :event_code, :success], :unique => true, :name => 'adyen_notification_uniqueness'
end