migrate to gtea from bistbucket
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('support_ticket_f_a_q_s', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('restaurant_id')->nullable();
|
||||
$table->string('question'); // Question field
|
||||
$table->text('answer'); // Answer field
|
||||
$table->smallInteger('status')->default(1)->comment('1=Active, 2=InActive');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('support_ticket_f_a_q_s');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('support_ticket_ip_infos', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('restaurant_id')->nullable();
|
||||
$table->string('ip_address');
|
||||
$table->string('country')->nullable();
|
||||
$table->string('division')->nullable();
|
||||
$table->string('city')->nullable();
|
||||
$table->string('zip_code')->nullable();
|
||||
$table->decimal('latitude', 10, 7)->nullable(); // Latitude with precision
|
||||
$table->decimal('longitude', 10, 7)->nullable(); // Longitude with precision
|
||||
$table->string('device_type')->nullable(); // Mobile, Desktop, etc.
|
||||
$table->string('browser')->nullable();
|
||||
$table->string('operating_system')->nullable();
|
||||
$table->timestamp('login_at')->nullable(); // Login timestamp
|
||||
$table->smallInteger('status')->default(1)->comment('1=Active, 2=InActive');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('support_ticket_ip_infos');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('support_ticket_categories', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('restaurant_id')->nullable();
|
||||
$table->string('name');
|
||||
$table->text('description')->nullable();
|
||||
$table->smallInteger('status')->default(1)->comment('1=Active, 2=InActive');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('support_ticket_categories');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('support_tickets', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('restaurant_id')->nullable();
|
||||
$table->string('readable_ticket_id')->nullable();
|
||||
$table->foreignId('user_id')->constrained('users')->onDelete('cascade');
|
||||
$table->foreignId('category_id')->nullable()->constrained('support_ticket_categories')->onDelete('cascade');
|
||||
$table->string('title');
|
||||
$table->text('description')->nullable();
|
||||
$table->string('purchase_code')->nullable();
|
||||
$table->boolean('read')->default(false);
|
||||
$table->string('related_url')->nullable();
|
||||
$table->string('support_plan')->nullable();
|
||||
$table->json('attachments')->nullable();
|
||||
$table->timestamp('last_conversation_time')->nullable();
|
||||
$table->timestamp('last_respond_by_client_at')->nullable();
|
||||
$table->enum('status', ['open', 'closed', 'pending', 'resolved'])->default('open');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('support_tickets');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('support_ticket_conversations', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('restaurant_id')->nullable();
|
||||
$table->foreignId('ticket_id')->constrained('support_tickets')->onDelete('cascade');
|
||||
$table->foreignId('user_id')->nullable()->constrained('users')->onDelete('cascade')->after('ticket_id');
|
||||
$table->text('message');
|
||||
$table->json('attachments')->nullable();
|
||||
$table->enum('user_type', ['user', 'agent', 'admin']);
|
||||
$table->smallInteger('status')->default(1)->comment('1=Active, 2=InActive');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('support_ticket_conversations');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('support_ticket_last_conversations', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('restaurant_id')->nullable();
|
||||
$table->foreignId('ticket_id')->constrained('support_tickets')->onDelete('cascade');
|
||||
$table->text('message');
|
||||
$table->enum('user_type', ['user', 'agent', 'admin']);
|
||||
$table->smallInteger('status')->default(1)->comment('1=Active, 2=InActive');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('support_ticket_last_conversations');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('support_ticket_licenses', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedBigInteger('restaurant_id')->nullable();
|
||||
$table->foreignId('ticket_id')->constrained('support_tickets')->onDelete('cascade');
|
||||
$table->string('license_code')->unique();
|
||||
$table->date('expires_date');
|
||||
$table->string('transaction_id')->nullable();
|
||||
$table->foreignId('user_id')->constrained('users')->onDelete('cascade');
|
||||
$table->smallInteger('status')->default(1)->comment('1=Active, 2=InActive');
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('support_ticket_licenses');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user