tomatophp / filament-ecommerce

Build your own ecommerce store with Filament & Splade
MIT License
34 stars 7 forks source link

Error on migrate:fresh #2

Closed pabloblazquez closed 1 month ago

pabloblazquez commented 1 month ago

SQLSTATE[HY000]: General error: 1215 Cannot add foreign key constraint (Connection: mysql, SQL: alter table orders add constraint orders_address_id_foreign foreign key (address_id) references locations (id) on delete cascade)

I think maybe it's all about some inconsistency in the order of launching migrations between your different plugins.

image

3x1io commented 1 month ago

hi @pabloblazquez thanks for your report, yes it was a problem on filament-locations and it's fixed now you can try it

YonkoSam commented 1 month ago

image

YonkoSam commented 1 month ago

im having a similer problem its fresh install laravel with filment

3x1io commented 1 month ago

what is your database driver?

YonkoSam commented 1 month ago

sqllite

3x1io commented 1 month ago

it's fine now i fix the seeder for SQLite

YonkoSam commented 1 month ago

yes the first problem is fixed but now there is a another one image

3x1io commented 1 month ago

use this and than migrate

php artisan vendor:publish --provider="Spatie\LaravelSettings\LaravelSettingsServiceProvider" --tag="migrations"

I add it to docs

YonkoSam commented 1 month ago

thank you it worked

pabloblazquez commented 1 month ago

I still have problems launching a "migrate fresh". Now the problem is with "base_tomato_ecommerce.settings'"

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'base_tomato_ecommerce.settings' doesn't exist (Connection: mysql, SQL: select exists(select * from settings where group = ordering and name = ordering_web_branch) as exists)

image

3x1io commented 1 month ago

if you check the docs

php artisan vendor:publish --provider="Spatie\LaravelSettings\LaravelSettingsServiceProvider" --tag="migrations"
php artisan filament-settings-hub:install
pabloblazquez commented 1 month ago

You're right, sorry, my bad. It went well this time.

I will try your development, good job!