handle add/remove homies in backend

This commit is contained in:
Bilal
2020-09-12 01:26:56 +03:00
parent 2a5ffac5b9
commit 013e4d144d
6 changed files with 42 additions and 20 deletions

View File

@@ -0,0 +1,5 @@
class AddDefaultChipToHomies < ActiveRecord::Migration[5.2]
def change
add_reference :homies, :chip
end
end

View File

@@ -0,0 +1,5 @@
class ChangeDefaultValueForImportanceInHomies < ActiveRecord::Migration[5.2]
def change
change_column_default :homies, :importance, 100
end
end

View File

@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2020_08_27_142428) do
ActiveRecord::Schema.define(version: 2020_09_11_171657) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@@ -37,10 +37,12 @@ ActiveRecord::Schema.define(version: 2020_08_27_142428) do
create_table "homies", force: :cascade do |t|
t.text "name", null: false
t.integer "importance", default: 5, null: false
t.integer "importance", default: 100, null: false
t.text "about"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.bigint "chip_id"
t.index ["chip_id"], name: "index_homies_on_chip_id"
end
create_table "money_moves", force: :cascade do |t|