From 4f1715023b98a9530adaf4f24b7aa3e2900d2024 Mon Sep 17 00:00:00 2001 From: cole alban Date: Fri, 24 Feb 2017 15:38:21 -0500 Subject: [PATCH] Add initial admin setup --- setup.rb | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/setup.rb b/setup.rb index 992184b..62d2d3e 100644 --- a/setup.rb +++ b/setup.rb @@ -4,10 +4,11 @@ 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") +class Run + 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' @@ -30,21 +31,14 @@ def bundle end end -def migrate_oysters - client = establish_db_connection - puts "Connection established" - client.query("SHOW TABLES").each do |tab| - puts tab - end - client.query("SELECT * FROM runs").each do |res| - puts "got result" - puts res - end +def setup_initial_admin + client = Mysql2::Client.new(host:'localhost' ,username:"colealban", password:"1156244Terps!", database: "Pearlception_development") + client.query("INSERT INTO companies (company_name, company_token, created_at, updated_at) VALUES (\"IVA\", \"a41b23cf-1d61-4fb4-9b69-0167abd7c583\",NOW(),NOW())") end ########## MAIN METHOD ##################### bundle #bundle install initial_migration #Setup db -#migrate_oysters +setup_initial_admin #add in og admin #Migrate all the oysters,runs,results from the AWS DB