Questions tagged [artisan-migrate]

192 questions
264
votes
8 answers

Safely remove migration In Laravel

In Laravel, there appears to be a command for creating a migration, but not removing. Create migration command: php artisan migrate:make create_users_table If I want to delete the migration, can I just safely delete the corresponding migrations …
Globalz
  • 4,474
  • 6
  • 34
  • 43
74
votes
7 answers

php artisan migrate:make create_mytable fails: "migrate:make" is not defined

When running the following command at the root of my Laravel 5 application, php artisan migrate:make create_mytable I get the following error: [InvalidArgumentException] Command "migrate:make" is not defined. Did you mean one of…
Jack
  • 1,343
  • 1
  • 9
  • 9
30
votes
22 answers

Laravel migration (errno: 150 "Foreign key constraint is incorrectly formed")

I have an orders table and a have a sell_shipping_labels which references orders.id as a foreign. However when I run the Laravel migration I get the dreaded error code: [Illuminate\Database\QueryException] SQLSTATE[HY000]: General error: 1005…
FrenchMajesty
  • 1,101
  • 2
  • 14
  • 29
26
votes
3 answers

Laravel 5 + PostgreSQL: "Database [postgres] not configured." Error

I'm trying to get started with Laravel + PostgreSQL and been following the database tutorial. Unfortunately, after updating the database configuration file and running php artisan migrate, the following error appears: [InvalidArgumentException] …
hodgef
  • 1,416
  • 2
  • 19
  • 31
13
votes
9 answers

PHP artisan migrate not creating new table

I am new to Laravel and I'm following Laravel Documentations as well as few Tutorial Videos. However, I am running this php artisan migrate code in my local CMD prompt and it's not creating Database Table in phpmyadmin. There are other few similar…
Prabin Parajuli
  • 551
  • 2
  • 12
  • 37
12
votes
4 answers

Mark migration as run in laravel

My migration failed, so I just ran a query manually in MySQL Workbench. Is there an artisan command to mark a migration as complete? So that when I run future migrations, it skips the ones I know don't need to be run. I can list them and their…
Andrew
  • 18,680
  • 13
  • 103
  • 118
10
votes
4 answers

How to use global prefix for tables in Laravel 5

New in Laravel. Probably a silly question. I had setup database like this: 'mysql' => [ 'driver' => 'mysql', 'host' => env('DB_HOST', 'localhost'), 'port' => env('DB_PORT', '3306'), 'database' => 'mydb', …
user6407527
9
votes
4 answers

How to run Laravel's artisan migrate one step at a time?

I already read Running one specific laravel 4 migration (single file) but this doesn't give me the answer. I want to know whether there is a way to run the command so that it just executes the next, and just this one migration. I have got 10 files…
hogan
  • 1,434
  • 1
  • 15
  • 32
9
votes
8 answers

problems with database connection in laravel 5

I use the command php artisan migrate to migrate my database connection but I still get the same error and I checked everything, nothing wrong. I used the same connection that I always use in Laravel 4.2 Here is the message I get on my…
Gaetan Sobze
  • 225
  • 2
  • 5
  • 13
8
votes
2 answers

Refresh laravel migration for specific table

Can I run php artisan migrate:refresh for specific table? Or can I refresh specific table migration in general? I tried this: php artisan migrate --path=/database/migrations/selected/ But it's not working!
CairoCoder
  • 3,091
  • 11
  • 46
  • 68
7
votes
2 answers

Laravel - PHP Fatal error: Class 'CreateMatchesTable' not found in migrate:refresh

Recently I cleaned up my tables locally, and this resulted in me deleting 'Match' table. I am now receiving errors on the production server because of this. Locally, I ran php artisan migrate:reset, deleted the 'CreateMatchesTable' file and then php…
user860511
6
votes
8 answers

"php artisan migrate" shows "nothing to migrate"

I am new to laravel. I am working on laravel version 6. I have created migration. It works nicely the first time, but if i change something in the migration file and then i run php artisan migrate it shows nothing to migrate. I tried php artisan…
Akshay Rathod
  • 1,593
  • 3
  • 10
  • 17
6
votes
2 answers

Laravel/Lumen Incorrect Table Name '' for migrations table SQLSTATE[42000]

When running php artisan migrate I get the an error when it is trying to create the migrations table in mysql: In Connection.php line 664: SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name '' (SQL: create table `` (`id`…
Paul
  • 2,465
  • 8
  • 35
  • 60
6
votes
1 answer

laravel php artisan migrate Error (timeout)

I am using Laravel 5.6 when I use the command 'php artisan migrate' I get this error (after a minute) : "Illuminate\Database\QueryException : SQLSTATE[HY000] [2002] Operation timed out (SQL: select * from information_schema.tables where…
khalil
  • 81
  • 2
  • 6
6
votes
3 answers

Custom laravel migration command "[Illuminate\Database\Migrations\MigrationRepositoryInterface] is not instantiable"

I'm trying to create a custom laravel (5.2) migration command that basically works the same as migrate:status except it just lists the pending migrations instead of all the migrations. To do this i've very simply copied the migrate:status into…
John Mellor
  • 2,351
  • 8
  • 45
  • 79
1
2 3
12 13