nWidart / laravel-modules

Module Management In Laravel
https://docs.laravelmodules.com
MIT License
5.5k stars 954 forks source link

Migration Command Not Working #1807

Closed RanjanGumanju closed 5 months ago

RanjanGumanju commented 6 months ago

Refreshing Migration Blog module ............................................................................. 12ms FAIL

Illuminate\Database\QueryException

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'migration' in 'where clause' (Connection: mysql, SQL: select count(*) as aggregate where migration = 2024_04_04_134727_create_posts_table)

at vendor/laravel/framework/src/Illuminate/Database/Connection.php:829 825▕ $this->getName(), $query, $this->prepareBindings($bindings), $e 826▕ ); 827▕ } 828▕ ➜ 829▕ throw new QueryException( 830▕ $this->getName(), $query, $this->prepareBindings($bindings), $e 831▕ ); 832▕ } 833▕ } While running every migration rollback commands, this issue encountered everytime.

dcblogdev commented 5 months ago

can you provide any other details? I've been unable to replicate this.

RanjanGumanju commented 5 months ago

image Every Migrate command(reset, refresh,rollback) not worked.

robertojohansalim commented 5 months ago

I found similar problem with fresh install of laravel 10.

I am able to migrate using php artisan module:migrate but unable to rollback using php artisan module:migrate-rollback I am able to rollback using php artisan migrate:rollback

Seems like the SQL STATE missing the table FROM statement, is this intended or am i missing something?

SQLSTATE[42703]: Undefined column: 7 ERROR:  column "batch" does not exist
LINE 1: select max("batch") as aggregate where "migration" in ($1)
                   ^ (Connection: pgsql, SQL: select max("batch") as aggregate where "migration" in (2024_04_17_085802_create_form))

Is it suppose to print select max("batch") as aggregate FROM "migrations" where "migration" in ($1) where the statement missing its FROM "migrations" part?

dcblogdev commented 5 months ago

I can't replicate this on L10 or 11

try doing a composer update