createTable('revenue', function($table) { $table->bigInteger('id')->autoIncrement()->notNull(); $table->decimal('amount', 10, 2)->default(0.00)->notNull()->comment('Revenue amount'); $table->string('source', 100)->nullable()->comment('Revenue source'); $table->string('category', 100)->nullable()->comment('Revenue category'); $table->text('description')->nullable()->comment('Revenue description'); $table->tinyInteger('status')->default(1)->notNull()->comment('0=inactive, 1=active, -1=deleted'); $table->timestamp('created_at')->default('CURRENT_TIMESTAMP')->notNull(); $table->timestamp('updated_at')->default('CURRENT_TIMESTAMP')->notNull(); $table->primaryKey('id'); $table->index(['status']); $table->index(['created_at']); $table->index(['source']); $table->index(['category']); $table->compositeIndex(['status', 'created_at'], 'idx_status_date'); }); } public function down(): void { $this->dropTable('revenue'); } }