Class: CreateGarnetClientNotices

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

Class Method Summary collapse

Class Method Details

.downObject



50
51
52
53
54
# File 'lib/generators/garnet_client/templates/migration.rb', line 50

def self.down
  drop_table :garnet_client_notice_deposits
  drop_table :garnet_client_notice_withdraws
  drop_table :garnet_client_notice_transactions
end

.upObject



2
3
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/generators/garnet_client/templates/migration.rb', line 2

def self.up
  create_table :garnet_client_notice_deposits do |t|
    t.string :coin_type
    t.string :contract_address
    t.string :from
    t.string :tx_hash
    t.string :to
    t.integer :value, :limit=>8
    t.integer :tx_timestamp
    t.integer :status
    t.string :notify_id
    t.string :error_msg
    t.datetime :read_at
    t.string :read_msg
    t.timestamps
  end

  create_table :garnet_client_notice_withdraws do |t|
    t.string :coin_type
    t.string :contract_address
    t.string :from
    t.string :tx_hash
    t.string :to
    t.integer :value, :limit=>8
    t.integer :tx_timestamp
    t.integer :status
    t.string :notify_id
    t.string :error_msg
    t.datetime :read_at
    t.string :read_msg
    t.timestamps
  end

  create_table :garnet_client_notice_transactions do |t|
    t.string :tx_id
    t.string :tx_hash
    t.integer :tx_timestamp
    t.string :from
    t.string :to
    t.integer :value, :limit=>8
    t.string :contract_address
    t.integer :status
    t.datetime :read_at
    t.string :read_msg
    t.timestamps
  end
end