-
Notifications
You must be signed in to change notification settings - Fork 823
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
php artisan migrate ❌ #1384
Comments
You shouldn't call the Having said that, it shouldn't create a duplicate migration. This seems to be caused by the switch to anonymous migrations which will prevent the current approach from detecting the existing migration. |
You shouldn't run This issue can be reproduced before using anonymous class but instead of query failing you'll get a duplicated class error from PHP. |
@crynobone There is code in the installer that attempts to prevent the duplicate migration: jetstream/src/Console/InstallCommand.php Lines 137 to 143 in e74e1e1
We should either make it work with anonymous migrations or remove it. |
We should also throw an error if Jetstream is already installed (maybe just checking for the Jetstream config file). It probably doesn't matter too much if you reinstall the same stack just with dark mode, but if you choose a different stack it would make a mess. |
jetstream/src/Console/InstallCommand.php Line 90 in ac29502
The code exists since And running |
Jetstream Version
4.x
Jetstream Stack
Livewire
Laravel Version
v10.25.1
PHP Version
v8.1.21
Database Driver & Version
mysql 5.7
Description
php artisan migrate
INFO Preparing database.
Creating migration table .............................................................. 24ms DONE
INFO Running migrations.
2014_10_12_000000_create_users_table .................................................. 30ms DONE
2014_10_12_100000_create_password_reset_tokens_table .................................. 35ms DONE
2014_10_12_200000_add_two_factor_columns_to_users_table ............................... 21ms DONE
2019_08_19_000000_create_failed_jobs_table ............................................ 26ms DONE
2019_12_14_000001_create_personal_access_tokens_table ................................. 38ms DONE
2023_09_30_192227_create_sessions_table ............................................... 59ms DONE
2023_09_30_192437_create_sessions_table ................................................ 2ms FAIL
Illuminate\Database\QueryException
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'sessions' already exists (Connection: mysql, SQL: create table
sessions
(id
varchar(255) not null,user_id
bigint unsigned null,ip_address
varchar(45) null,user_agent
text null,payload
longtext not null,last_activity
int not null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')at vendor/laravel/framework/src/Illuminate/Database/Connection.php:801
797▕ $this->getName(), $query, $this->prepareBindings($bindings), $e
798▕ );
799▕ }
800▕
➜ 801▕ throw new QueryException(
802▕ $this->getName(), $query, $this->prepareBindings($bindings), $e
803▕ );
804▕ }
805▕ }
10 database/migrations/2023_09_30_192437_create_sessions_table.php:21
Illuminate\Support\Facades\Facade::__callStatic()
+24 vendor frames
35 artisan:37
Illuminate\Foundation\Console\Kernel::handle()
Steps To Reproduce
composer create-project laravel/laravel example-app
cd example-app
composer require laravel/jetstream
php artisan jetstream:install livewire
php artisan jetstream:install livewire --dark
npm install
npm run build
php artisan migrate
The text was updated successfully, but these errors were encountered: