Homies and money moves
This commit is contained in:
10
db/migrate/20190620194110_create_homies.rb
Normal file
10
db/migrate/20190620194110_create_homies.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class CreateHomies < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :homies do |t|
|
||||
t.text :name, null: false
|
||||
t.integer :importance, null: false, default: 5
|
||||
t.text :about
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
11
db/migrate/20190620200006_create_money_moves.rb
Normal file
11
db/migrate/20190620200006_create_money_moves.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class CreateMoneyMoves < ActiveRecord::Migration[5.2]
|
||||
def change
|
||||
create_table :money_moves do |t|
|
||||
t.text :description
|
||||
t.decimal :amount, precision: 12, scale: 3
|
||||
t.integer :from_homie_id, null: false
|
||||
t.integer :to_homie_id, null: false
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
35
db/schema.rb
Normal file
35
db/schema.rb
Normal file
@@ -0,0 +1,35 @@
|
||||
# This file is auto-generated from the current state of the database. Instead
|
||||
# of editing this file, please use the migrations feature of Active Record to
|
||||
# incrementally modify your database, and then regenerate this schema definition.
|
||||
#
|
||||
# Note that this schema.rb definition is the authoritative source for your
|
||||
# database schema. If you need to create the application database on another
|
||||
# system, you should be using db:schema:load, not running all the migrations
|
||||
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
||||
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(version: 2019_06_20_200006) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
||||
create_table "homies", force: :cascade do |t|
|
||||
t.text "name", null: false
|
||||
t.integer "importance", default: 5, null: false
|
||||
t.text "about"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "money_moves", force: :cascade do |t|
|
||||
t.text "description"
|
||||
t.decimal "amount", precision: 12, scale: 3
|
||||
t.integer "from_homie_id", null: false
|
||||
t.integer "to_homie_id", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user