<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AlterProfessionalTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
Schema::table('professionals', function (Blueprint $table) {
//
$table->timestamps();
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
$table->dropTimestamps();
}
}
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class AlterProfessionalTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
//
Schema::table('professionals', function (Blueprint $table) {
//
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
$table->dropTimestamps();
}
}
$ php artisan migrate
Migrating: 2020_01_02_171926_add_user_id_to_pages_table
Migrated: 2020_01_02_171926_add_user_id_to_pages_table (0.07 seconds)
Migrating: 2020_01_29_224553_create_practioners_table
Migrated: 2020_01_29_224553_create_practioners_table (0.05 seconds)
Migrating: 2020_01_29_231018_create_professional_table
Illuminate\Database\QueryException : SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'professionals' alread
y exists (SQL: create table `professionals` (`id` bigint unsigned not null auto_increment primary key, `cert_year` int not nul
l, `cert_num` varchar(191) not null, `lname` varchar(191) not null, `fname` varchar(191) not null, `addr1` varchar(191) not nu
ll, `addr2` varchar(191) not null, `city` varchar(191) not null, `region_state` varchar(191) not null, `country` varchar(191)
not null, `postal` varchar(191) not null, `discipline` varchar(191) not null, `phone` varchar(191) not null, `email` varchar(1
91) not null, `license` int not null, `created_at` timestamp null, `updated_at` timestamp null) default character set utf8mb4
collate 'utf8mb4_unicode_ci')
at C:\wamp64\www\new_nomas\vendor\laravel\framework\src\Illuminate\Database\Connection.php:665
661| // If an exception occurs when attempting to run a query, we'll format the error
662| // message to include the bindings with SQL, which will make this exception a
663| // lot more helpful to the developer instead of just the database's errors.
664| catch (Exception $e) {
> 665| throw new QueryException(
666| $query, $this->prepareBindings($bindings), $e
667| );
668| }
669|
Exception trace:
1 PDOException::("SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'professionals' already exists")
C:\wamp64\www\new_nomas\vendor\laravel\framework\src\Illuminate\Database\Connection.php:459
2 PDOStatement::execute()
C:\wamp64\www\new_nomas\vendor\laravel\framework\src\Illuminate\Database\Connection.php:459
Please use the argument -v to see more details.
Simple typo - you've not closed off your closure:
Open in new window