-
Notifications
You must be signed in to change notification settings - Fork 80
Clean up DatabaseSeeder #3061
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up DatabaseSeeder #3061
Conversation
josephsnyder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the changes made causes the php artisan migrate --seed to fail to complete because [DatabaseSeeder] does not exist:
php artisan db:wipe && php artisan migrate --seed
INFO Dropped all tables successfully.
INFO Preparing database.
Creating migration table ............................................................................................................ 26.07ms DONE
INFO Running migrations.
2000_01_01_000000_load_from_schema ....................................................................................................... 1s DONE
2019_06_24_140207_create_saml2_tenants_table ........................................................................................ 32.83ms DONE
2020_10_22_140856_add_relay_state_url_column_to_saml2_tenants_table .................................................................. 4.18ms DONE
2020_10_23_072902_add_name_id_format_column_to_saml2_tenants_table ................................................................... 2.99ms DONE
2025_06_16_152800_decompress_test_output ............................................................................................ 16.48ms DONE
2025_06_17_140642_drop_note_crc32 .................................................................................................... 4.26ms DONE
2025_06_24_222844_renormalize_label2coveragefile .................................................................................... 21.66ms DONE
2025_07_17_142900_decompress_coveragefile ............................................................................................ 5.67ms DONE
2025_07_24_173132_coveragefilelog_bytea_to_text ...................................................................................... 5.09ms DONE
2025_07_25_131613_coverage_view ...................................................................................................... 4.26ms DONE
2025_07_27_214956_coverage_file_newlines ............................................................................................. 1.90ms DONE
2025_07_30_131713_test_status_enum .................................................................................................. 12.55ms DONE
2025_08_07_181941_test2image_test_relationship ...................................................................................... 22.85ms DONE
2025_08_12_182732_test_id_column_type ................................................................................................ 7.22ms DONE
2025_08_18_171650_image_id_column_type .............................................................................................. 66.07ms DONE
INFO Seeding database.
In Container.php line 1045:
Target class [DatabaseSeeder] does not exist.
In Container.php line 1043:
Class "DatabaseSeeder" does not exist
This doesn't occur on master. I assumed it was the removal of the Artisan facade, but putting that back doesn't seem to fix it. Does it work locally for you?
|
@josephsnyder It's probably related to the |
@williamjallen, the branch was installed into the container via |
fb42cb4 to
b10900f
Compare
|
@josephsnyder It looks like I needed to run |
josephsnyder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better! Thanks!
One more question: how does someone expect to sign in without accessing the database first?
With the previous information set of information, one could see the login information in code and expect it to be static between cycles of wipe/seed. Now, the admin account has a non-determinant email albeit with the same password. Are they expected to create their own admin user?
b10900f to
903a0b1
Compare
|
@josephsnyder Good point. We should probably have some normal users with predefined credentials too. For now, I've reverted the changes to the admin user and I'll improve the fixed users in a future PR. |
josephsnyder
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great. Thanks for the quick answers!
Recent versions of Laravel changed how database seeding is supposed to be done. This PR switches to the new format, while also cleaning up a handful of other broken factory/seeder related things.