From c0b2c96d11321be37428cf97ad837197ba2931ce Mon Sep 17 00:00:00 2001 From: cole alban Date: Fri, 24 Feb 2017 14:46:28 -0500 Subject: [PATCH] fix mysql --- setup.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/setup.rb b/setup.rb index e93f8ef..9555cc9 100644 --- a/setup.rb +++ b/setup.rb @@ -1,6 +1,13 @@ #Link every result to run id 48 +require 'mysql2' require 'fileutils' +$company_data_endpoint = "companydata.c02zesysnssi.us-west-2.rds.amazonaws.com" + +def establish_db_connection + client = Mysql2::Client.new(host:$company_data_endpoint, username:"ivauser", password:"ivapassword", database: "Hooper's Island") +end + #This will run the initial migration that sets up the db to be apartment friendly def initial_migration apartment_copy_path = 'init/apartment.rb' @@ -23,8 +30,16 @@ def bundle end end +def migrate_oysters + client = establish_db_connection + client.query("SELECT * FROM oysters").each do |res| + puts res + end +end + ########## MAIN METHOD ##################### bundle #bundle install initial_migration #Setup db +migrate_oysters #add in og admin #Migrate all the oysters,runs,results from the AWS DB