add migration provider table
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('providers', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('organization_id')->index();
|
||||
$table->string('name');
|
||||
$table->string('code');
|
||||
$table->string('header_token')->nullable();
|
||||
$table->string('username');
|
||||
$table->text('password');
|
||||
$table->string('status')->default('active');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->foreignId('created_by')->nullable();
|
||||
$table->foreignId('updated_by')->nullable();
|
||||
$table->foreignId('deleted_by')->nullable();
|
||||
|
||||
$table->unique(['organization_id', 'code']);
|
||||
$table->foreign('organization_id')->references('id')->on('organizations')->onDelete('cascade');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('providers');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user