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

Migration Error #141

Open
AboutErfan opened this issue Dec 25, 2022 · 6 comments
Open

Migration Error #141

AboutErfan opened this issue Dec 25, 2022 · 6 comments

Comments

@AboutErfan
Copy link

Hi, When I want run php artisan migrate, I've got this error:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel.pagebuilder__settings' doesn't exist

How I can fix this?

thanks a lot

@podcasthosting
Copy link

podcasthosting commented Dec 30, 2022

We have the same problem on a fresh installation. Forcing a downgrade to v0.21.0 fixed the issue. But that of course is an old version of the package.

How I can fix this?

@AboutErfan You can manually copy over the migrations file from the vendor directory
/vendor/hansschouten/laravel-pagebuilder/migrations/
and then execute
php artisan migrate

That will create the missing tables. Afterwards things run smoothly.

@ali-amento
Copy link

Run

php artisan migrate

Before publishing the config file,

@arvindjkhr
Copy link

@ali-amento - I tried to do the same as well but could not succeed in this can you please make a small video about how to set this up from scratch and share the link here?

@handhikadj
Copy link

@ali-amento - I tried to do the same as well but could not succeed in this can you please make a small video about how to set this up from scratch and share the link here?

you need to delete the config/pagebuilder.php first before running the migrate command

@emincer
Copy link

emincer commented Apr 3, 2023

you need to delete the config/pagebuilder.php first before running the migrate command

This was helpful... however, something seems to be wrong with the config file before publishing. The code looks like it wants to use a prefix:
'prefix' => 'pagebuilder__',
But that seems ti fail because the migration is just creating a table called pages, which I already have. Had it worked properly it would have created pagebuilder__pages which would be perfect. So I changed the migration code to use '_pages' and it ran. Knowing that wasn't the right fix, just an experiment, I went to rollback the migration, which fails with SQLSTATE[42S02]: Base table or view not found: 1146 Table 'laravel.pagebuilder__settings' doesn't exist.

So ironically the rollback wants to use correct naming with the prefix but the migration seems to totally ignore the prefix. This is Laravel version 9. I'm unable to even rollback my experiment.

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

7 participants
@emincer @handhikadj @podcasthosting @arvindjkhr @AboutErfan @ali-amento and others