Skip to content
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

Database migration fails on initial install #2

Closed
coderintherye opened this issue Jul 23, 2023 · 1 comment
Closed

Database migration fails on initial install #2

coderintherye opened this issue Jul 23, 2023 · 1 comment

Comments

@coderintherye
Copy link

Fresh install of latest main:

php artisan migrate
Migration table created successfully.
Migrating: 2014_10_12_100000_create_password_resets_table
Migrated: 2014_10_12_100000_create_password_resets_table (9.91ms)
Migrating: 2019_08_19_000000_create_failed_jobs_table
Migrated: 2019_08_19_000000_create_failed_jobs_table (8.00ms)
Migrating: 2019_12_14_000001_create_personal_access_tokens_table
Migrated: 2019_12_14_000001_create_personal_access_tokens_table (13.09ms)
Migrating: 2021_11_09_090003_create_transaction_histories_table
Migrated: 2021_11_09_090003_create_transaction_histories_table (3.16ms)
Migrating: 2021_11_18_093131_create_emailsubscriptions_table
Migrated: 2021_11_18_093131_create_emailsubscriptions_table (6.69ms)
Migrating: 2021_11_18_093532_create_messages_table
Migrated: 2021_11_18_093532_create_messages_table (7.31ms)
Migrating: 2021_12_09_235657_create_reg_employee_attachments_table

Illuminate\Database\QueryException

SQLSTATE[HY000]: General error: 1824 Failed to open the referenced table 'reg_employee_mst' (SQL: alter table reg_employee_attachments add constraint reg_employee_attachments_employee_id_foreign foreign key (employee_id) references reg_employee_mst (employee_id) on delete cascade)

@coderintherye
Copy link
Author

Ahh I realize you documented this in the install steps. However, could it make sense to redo the migrations to be in order so the extra step isn't needed anymore? I could submit a patch for that if helpful.

For others, before running php artisan migrate you first need to run
php artisan migrate --path=database/migrations/2022_01_31_191309_create_reg_employee_msts_table.php

@coderintherye coderintherye closed this as not planned Won't fix, can't repro, duplicate, stale Jul 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant