Skip to content

Commit

Permalink
feat: add block_propagation_delay table
Browse files Browse the repository at this point in the history
  • Loading branch information
shaojunda committed May 12, 2020
1 parent b40a5e2 commit 09c7643
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
18 changes: 18 additions & 0 deletions app/models/block_propagation_delay.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
class BlockPropagationDelay < ApplicationRecord
end

# == Schema Information
#
# Table name: block_propagation_delays
#
# id :bigint not null, primary key
# block_hash :string
# created_at_unixtimestamp :integer
# durations :jsonb
# created_at :datetime not null
# updated_at :datetime not null
#
# Indexes
#
# index_block_propagation_delays_on_created_at_unixtimestamp (created_at_unixtimestamp)
#
11 changes: 11 additions & 0 deletions db/migrate/20200509144539_create_block_propagation_delays.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class CreateBlockPropagationDelays < ActiveRecord::Migration[6.0]
def change
create_table :block_propagation_delays do |t|
t.string :block_hash
t.integer :created_at_unixtimestamp, index: true
t.jsonb :durations

t.timestamps
end
end
end
11 changes: 10 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2020_05_06_043401) do
ActiveRecord::Schema.define(version: 2020_05_09_144539) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -43,6 +43,15 @@
t.index ["lock_hash"], name: "index_addresses_on_lock_hash", unique: true
end

create_table "block_propagation_delays", force: :cascade do |t|
t.string "block_hash"
t.integer "created_at_unixtimestamp"
t.jsonb "durations"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["created_at_unixtimestamp"], name: "index_block_propagation_delays_on_created_at_unixtimestamp"
end

create_table "block_statistics", force: :cascade do |t|
t.string "difficulty"
t.string "hash_rate"
Expand Down

0 comments on commit 09c7643

Please sign in to comment.