From 81d7b40190432a50883e42698322eca12589c814 Mon Sep 17 00:00:00 2001 From: Tom Naessens Date: Tue, 8 Sep 2015 15:22:26 +0200 Subject: [PATCH 1/4] Bundle update --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 13ddcb2..c9ade6e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -117,7 +117,7 @@ GEM multi_json (1.11.2) multi_xml (0.5.5) multipart-post (2.0.0) - mysql2 (0.3.20) + mysql2 (0.4.0) net-scp (1.2.1) net-ssh (>= 2.6.5) net-ssh (2.9.2) From 9cbd5a141cc7ebd792bdddf959d37707ed4c1177 Mon Sep 17 00:00:00 2001 From: Tom Naessens Date: Tue, 8 Sep 2015 15:24:13 +0200 Subject: [PATCH 2/4] Pin mysql again --- Gemfile | 2 +- Gemfile.lock | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 660532a..9746c25 100644 --- a/Gemfile +++ b/Gemfile @@ -71,7 +71,7 @@ group :development do end group :production do - gem 'mysql2' + gem 'mysql2', '~> 0.3.0' end gem 'high_voltage', '~> 2.4.0' diff --git a/Gemfile.lock b/Gemfile.lock index fe7dbff..b4cde59 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -118,7 +118,7 @@ GEM multi_json (1.11.2) multi_xml (0.5.5) multipart-post (2.0.0) - mysql2 (0.4.0) + mysql2 (0.3.20) net-scp (1.2.1) net-ssh (>= 2.6.5) net-ssh (2.9.2) @@ -246,7 +246,7 @@ DEPENDENCIES jbuilder (~> 2.0) jquery-datatables-rails (~> 3.3.0) jquery-rails - mysql2 + mysql2 (~> 0.3.0) omniauth-oauth2 purecss-rails rails (= 4.2.4) From aadf6151229001c5659f91b353e83b4cad9afbf5 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Tue, 8 Sep 2015 15:37:02 +0200 Subject: [PATCH 3/4] fix transaction foreign keys --- db/migrate/20150908091546_create_transactions.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/db/migrate/20150908091546_create_transactions.rb b/db/migrate/20150908091546_create_transactions.rb index de40fa3..6fc8ad4 100644 --- a/db/migrate/20150908091546_create_transactions.rb +++ b/db/migrate/20150908091546_create_transactions.rb @@ -1,13 +1,16 @@ class CreateTransactions < ActiveRecord::Migration def change create_table :transactions do |t| - t.references :debtor, index: true, foreign_key: true, null: false - t.references :creditor, index: true, foreign_key: true, null: false + t.references :debtor, index: true, null: false + t.references :creditor, index: true, null: false t.integer :amount, null: false, default: 0 t.string :origin, null: false t.string :message t.timestamps null: false end + + add_foreign_key :transactions, :users, :creditor_id + add_foreign_key :transactions, :users, :debtor_id end end From ec4f0419869c574966c9f23be280df6114152320 Mon Sep 17 00:00:00 2001 From: Ilion Beyst Date: Tue, 8 Sep 2015 15:42:08 +0200 Subject: [PATCH 4/4] fix foreign keys in mysql --- db/migrate/20150908091546_create_transactions.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/migrate/20150908091546_create_transactions.rb b/db/migrate/20150908091546_create_transactions.rb index 6fc8ad4..dda51f7 100644 --- a/db/migrate/20150908091546_create_transactions.rb +++ b/db/migrate/20150908091546_create_transactions.rb @@ -10,7 +10,7 @@ class CreateTransactions < ActiveRecord::Migration t.timestamps null: false end - add_foreign_key :transactions, :users, :creditor_id - add_foreign_key :transactions, :users, :debtor_id + add_foreign_key :transactions, :users, column: :creditor_id + add_foreign_key :transactions, :users, column: :debtor_id end end