mirror of
https://github.com/filamentphp/filament.git
synced 2026-09-24 15:42:09 +08:00
Check for password_resets table in migration
This commit is contained in:
@@ -6,6 +6,13 @@ use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreatePasswordResetsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* The name of the table for the migration.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $tableName = 'password_resets';
|
||||
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
@@ -13,11 +20,13 @@ class CreatePasswordResetsTable extends Migration
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('password_resets', function (Blueprint $table) {
|
||||
$table->string('email')->index();
|
||||
$table->string('token');
|
||||
$table->timestamp('created_at')->nullable();
|
||||
});
|
||||
if (!Schema::hasTable($this->tableName)) {
|
||||
Schema::create($this->tableName, function (Blueprint $table) {
|
||||
$table->string('email')->index();
|
||||
$table->string('token');
|
||||
$table->timestamp('created_at')->nullable();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -27,6 +36,6 @@ class CreatePasswordResetsTable extends Migration
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('password_resets');
|
||||
Schema::dropIfExists($this->tableName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ class AlpineServiceProvider extends ServiceProvider
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $packagePath = __DIR__ . '/../';
|
||||
protected $packagePath = __DIR__.'/../';
|
||||
|
||||
/**
|
||||
* Register bindings in the container.
|
||||
|
||||
Reference in New Issue
Block a user