This commit is contained in:
benji 2015-09-08 15:51:26 +02:00
commit eab254aa4a
3 changed files with 7 additions and 4 deletions

View file

@ -71,7 +71,7 @@ group :development do
end end
group :production do group :production do
gem 'mysql2' gem 'mysql2', '~> 0.3.0'
end end
gem 'high_voltage', '~> 2.4.0' gem 'high_voltage', '~> 2.4.0'

View file

@ -246,7 +246,7 @@ DEPENDENCIES
jbuilder (~> 2.0) jbuilder (~> 2.0)
jquery-datatables-rails (~> 3.3.0) jquery-datatables-rails (~> 3.3.0)
jquery-rails jquery-rails
mysql2 mysql2 (~> 0.3.0)
omniauth-oauth2 omniauth-oauth2
purecss-rails purecss-rails
rails (= 4.2.4) rails (= 4.2.4)

View file

@ -1,13 +1,16 @@
class CreateTransactions < ActiveRecord::Migration class CreateTransactions < ActiveRecord::Migration
def change def change
create_table :transactions do |t| create_table :transactions do |t|
t.references :debtor, index: true, foreign_key: true, null: false t.references :debtor, index: true, null: false
t.references :creditor, index: true, foreign_key: true, null: false t.references :creditor, index: true, null: false
t.integer :amount, null: false, default: 0 t.integer :amount, null: false, default: 0
t.string :origin, null: false t.string :origin, null: false
t.string :message t.string :message
t.timestamps null: false t.timestamps null: false
end end
add_foreign_key :transactions, :users, column: :creditor_id
add_foreign_key :transactions, :users, column: :debtor_id
end end
end end