Skip to content

Commit

Permalink
feat: add new columns to daily statistic
Browse files Browse the repository at this point in the history
  • Loading branch information
shaojunda committed Jan 15, 2020
1 parent 11684be commit 0a013c4
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
6 changes: 6 additions & 0 deletions app/models/daily_statistic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,10 @@ class DailyStatistic < ApplicationRecord
# mining_reward :string default("0")
# deposit_compensation :string default("0")
# treasury_amount :string default("0")
# live_cells_count :string default("0")
# dead_cells_count :string default("0")
# avg_hash_rate :string default("0")
# avg_difficulty :string default("0")
# uncle_rate :string default("0")
# total_depositors_count :string default("0")
#
10 changes: 10 additions & 0 deletions db/migrate/20200115020206_add_new_columns_to_daily_statistic.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
class AddNewColumnsToDailyStatistic < ActiveRecord::Migration[6.0]
def change
add_column :daily_statistics, :live_cells_count, :string, default: "0"
add_column :daily_statistics, :dead_cells_count, :string, default: "0"
add_column :daily_statistics, :avg_hash_rate, :string, default: "0"
add_column :daily_statistics, :avg_difficulty, :string, default: "0"
add_column :daily_statistics, :uncle_rate, :string, default: "0"
add_column :daily_statistics, :total_depositors_count, :string, default: "0"
end
end
8 changes: 7 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_01_10_123617) do
ActiveRecord::Schema.define(version: 2020_01_15_020206) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand Down Expand Up @@ -172,6 +172,12 @@
t.string "mining_reward", default: "0"
t.string "deposit_compensation", default: "0"
t.string "treasury_amount", default: "0"
t.string "live_cells_count", default: "0"
t.string "dead_cells_count", default: "0"
t.string "avg_hash_rate", default: "0"
t.string "avg_difficulty", default: "0"
t.string "uncle_rate", default: "0"
t.string "total_depositors_count", default: "0"
end

create_table "dao_contracts", force: :cascade do |t|
Expand Down

0 comments on commit 0a013c4

Please sign in to comment.