<repo_name>Pougliche/doctolibkiller<file_sep>/db/seeds.rb
require 'faker'
require 'colorize'

20.times do |index|
    city = City.create!(city_name: Faker::Address.city)
        specialty = Specialty.create!(specialty_name: Faker::DcComics.hero)
end

100.times do |index|
    med = Doctor.create!(first_name: Faker::Name.first_name, last_name: Faker::Name.last_name, city: City.all.sample)
        patient = Patient.create!(first_name: Faker::Name.first_name, last_name: Faker::Name.last_name, city: City.all.sample)

3.times do 
    specialty = SpecialRef.create(doctor: med, specialty: Specialty.all.sample)
end
    appointment = Appointment.create(doctor: med, patient: Patient.all.sample, city: med.city, specialty: SpecialRef.where(doctor: med).sample.specialty, date_time: Faker::Time.forward(days: 30))
end

puts "20 CITIES AND MEDICAL SPECIALTIES HAVE BEEN CREATED. 100 DOCTORS, PATIENTS AND APPOINTMENTS HAVE BEEN CREATED. WHERE IS YOUR GOD NOW?".green<file_sep>/README.md
Doctolibkiller Database 8.6 ; by <NAME>. & <NAME>.

Ruby 2.5.1 is needed to run this database
Don't forget to #bundle install before running tests !

This program will allow you to check through Doctolibkiller's database, here's a little guide to check through it :

- $rails db:migrate to put all migrations up

- $rails db:seed to create some data

- $rails console to ignite

- put $tp in front of your search to get the result in a nice table ! Using the gem "table print".

- The database contains doctors, patients, appointments, medical specialties and cities. Each class goes as follows :

Doctor, Patient, Appointment, Specialty, City

Exemple of search : $tp Doctor.all   > will show you the list of doctors in a nice table

Have fun with it !