mirror of
https://github.com/oonyeje/Pearlception_Website_RoR.git
synced 2025-12-25 11:47:41 +00:00
Add initial admin setup
This commit is contained in:
parent
da0d2a215d
commit
4f1715023b
20
setup.rb
20
setup.rb
@ -4,10 +4,11 @@ require 'fileutils'
|
|||||||
|
|
||||||
$company_data_endpoint = "companydata.c02zesysnssi.us-west-2.rds.amazonaws.com"
|
$company_data_endpoint = "companydata.c02zesysnssi.us-west-2.rds.amazonaws.com"
|
||||||
|
|
||||||
def establish_db_connection
|
class Run
|
||||||
client = Mysql2::Client.new(host:$company_data_endpoint, username:"ivauser", password:"ivapassword", database: "Hooper's Island")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
#This will run the initial migration that sets up the db to be apartment friendly
|
#This will run the initial migration that sets up the db to be apartment friendly
|
||||||
def initial_migration
|
def initial_migration
|
||||||
apartment_copy_path = 'init/apartment.rb'
|
apartment_copy_path = 'init/apartment.rb'
|
||||||
@ -30,21 +31,14 @@ def bundle
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def migrate_oysters
|
def setup_initial_admin
|
||||||
client = establish_db_connection
|
client = Mysql2::Client.new(host:'localhost' ,username:"colealban", password:"1156244Terps!", database: "Pearlception_development")
|
||||||
puts "Connection established"
|
client.query("INSERT INTO companies (company_name, company_token, created_at, updated_at) VALUES (\"IVA\", \"a41b23cf-1d61-4fb4-9b69-0167abd7c583\",NOW(),NOW())")
|
||||||
client.query("SHOW TABLES").each do |tab|
|
|
||||||
puts tab
|
|
||||||
end
|
|
||||||
client.query("SELECT * FROM runs").each do |res|
|
|
||||||
puts "got result"
|
|
||||||
puts res
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
########## MAIN METHOD #####################
|
########## MAIN METHOD #####################
|
||||||
bundle #bundle install
|
bundle #bundle install
|
||||||
initial_migration #Setup db
|
initial_migration #Setup db
|
||||||
#migrate_oysters
|
setup_initial_admin
|
||||||
#add in og admin
|
#add in og admin
|
||||||
#Migrate all the oysters,runs,results from the AWS DB
|
#Migrate all the oysters,runs,results from the AWS DB
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user