Replies: 3 comments 1 reply
-
database_path('migrations/'.date('Y_m_d_His', time()).'_create_ratings_table.php') This pattern might work well before Laravel moves to |
Beta Was this translation helpful? Give feedback.
-
Hmm, so I just changed it to __DIR__.'/../workbench/database/migrations/2023_09_16_003400_create_ratings_table.php' => database_path('migrations/0000_00_00_000000_create_ratings_table.php'), But INFO Running migrations.
0000_00_00_000000_create_ratings_table .............................................................................. 4ms DONE
2014_10_12_000000_testbench_create_users_table ...................................................................... 1ms DONE
2014_10_12_100000_testbench_create_password_reset_tokens_table ...................................................... 0ms DONE
2019_08_19_000000_testbench_create_failed_jobs_table ................................................................ 1ms DONE
2023_09_14_230134_create_ratings_table .............................................................................. 1ms FAIL Not sure where I checked Is this the right way to do the migrations in the testbench package, or have I missed anything? Thanks for the pointer! |
Beta Was this translation helpful? Give feedback.
-
This is an issue with any packages using Before this, each migrations has a unique class name and Laravel will throw duplicate class exception if you try publishing package migrations more than once, and it's no longer possible with You can use |
Beta Was this translation helpful? Give feedback.
-
Description:
When I run either of
testbench workbench:build
testbench package:test
pest --filter="some test"
I get an error saying that a table already exists
Steps To Reproduce:
I'm trying to do this on my package https://github.com/cjmellor/rating
I have a
create_ratings_table.php
file withindatabase/migrations
.My
testbench.yaml
file:This is the Service Provider
This is the TestCase.php code:
I ran both
testbench workbench:install
testbench workbench:build
Which gives me an output:
It seems the migration is generated twice and trying to run twice.
Cannot for the life of me figure out why.
Thanks for taking the time to look.
Beta Was this translation helpful? Give feedback.
All reactions