fixed migration
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
@@ -138,9 +138,9 @@ return new class extends Migration
|
||||
// Purchase History
|
||||
if (! Schema::hasTable('purchase_history')) {
|
||||
Schema::create('purchase_history', function (Blueprint $table) {
|
||||
$table->string('id', 255)->primary();
|
||||
$table->string('tenant_id', 255);
|
||||
$table->string('package_id', 255);
|
||||
$table->bigIncrements('id');
|
||||
$table->foreignId('tenant_id')->constrained('tenants');
|
||||
$table->unsignedBigInteger('package_id');
|
||||
$table->integer('credits_added')->default(0);
|
||||
$table->decimal('price', 10, 2)->default(0);
|
||||
$table->string('currency', 3)->default('EUR');
|
||||
@@ -148,10 +148,9 @@ return new class extends Migration
|
||||
$table->string('transaction_id', 255)->nullable();
|
||||
$table->timestamp('purchased_at')->useCurrent();
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
$table->foreign('tenant_id')->references('id')->on('tenants');
|
||||
$table->index('tenant_id');
|
||||
$table->index('purchased_at');
|
||||
$table->index('transaction_id');
|
||||
$table->foreign('package_id')->references('id')->on('packages');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user