| 1234567891011121314151617181920212223242526272829303132333435 |
- <?php
- use Illuminate\Database\Migrations\Migration;
- use Illuminate\Database\Schema\Blueprint;
- use Illuminate\Support\Facades\Schema;
- return new class extends Migration
- {
- /**
- * Run the migrations.
- */
- public function up(): void
- {
- Schema::create('datatables', function (Blueprint $table) {
- $table->id();
- $table->string('name'); // Unique name for the DataTable
- $table->string('description')->nullable(); // Optional description
- $table->string('base_table'); // Base table name (e.g., 'employees')
- $table->json('columns'); // JSON structure for column configuration
- $table->json('joins')->nullable(); // JSON structure for joins
- $table->json('conditions')->nullable(); // JSON for WHERE conditions
- $table->json('default_sorting')->nullable(); // Default sorting rules
- $table->timestamps();
- });
- }
- /**
- * Reverse the migrations.
- */
- public function down(): void
- {
- Schema::dropIfExists('datatables');
- }
- };
|