sarapis / orservices

ORServices is an open source, smartphone-friendly directory application that enables you to collect, verify, organize and share information about social services in your community with your stakeholders, beneficiaries, partner organizations and more.
https://sarapis.org/human-services/orservices/
22 stars 16 forks source link

Install instructions clarification re DB migrations and importing #82

Open ChrisHardie opened 2 years ago

ChrisHardie commented 2 years ago

The installation instructions currently specify that artisan migrate is to be run before the the DB dump is imported manually. In my case, this led to a migration error:

Cannot declare class CreateSchedulesTable, because the name is already in use

Indeed:

$ grep -r 'CreateSchedulesTable' database/migrations/*
database/migrations/2020_06_13_094604_create_schedules_table.php:class CreateSchedulesTable extends Migration
database/migrations/2020_11_28_061354_create_schedules_table.php:class CreateSchedulesTable extends Migration

But when I imported the database dump first (mysql -u orservices orservices < database/dump/15022021.sql) and then ran the migrations, everything worked okay.

Unless I'm missing something, should the README be updated to reflect this order of operations?

(Related, is it a goal to get all of the initial DB data imported via seeding, or are there good reasons for having it done via a direct SQL file import?)

devinbalkind commented 2 years ago

Great questions.

I'm curious what @d9it and @bmunyoki think about this.

d9it commented 2 years ago

Hi Chris,

  1. If you import the database manually then no need to use php artisan migrate.
  2. Cannot declare class CreateSchedulesTable, because the name is already in use -: == This issue has been resolved.
ChrisHardie commented 2 years ago
  1. If you import the database manually then no need to use php artisan migrate.

FWIW I did try just importing manually, but there was brokenness until I ran the migrations.

d9it commented 2 years ago

Below is the updated SQL dump file.

https://github.com/sarapis/orservices/blob/master/database/dump/09112021.sql

Can you please try again with importing manually?

Let me know if you are still facing any issues. Thanks!