diff --git a/database/migrations/2024_08_02_081858_create_isp_billing_cycle_table.php b/database/migrations/2024_08_02_081858_create_isp_billing_cycle_table.php index 345eeda..52f5b42 100644 --- a/database/migrations/2024_08_02_081858_create_isp_billing_cycle_table.php +++ b/database/migrations/2024_08_02_081858_create_isp_billing_cycle_table.php @@ -18,13 +18,15 @@ public function up(): void $table->string('slug'); $table->string('description')->nullable(); $table->string('duration')->nullable(); - $table->enum('duration_type', ['day', 'week', 'month', 'year'])->default('month')->nullable(); + $table->enum('duration_type', ['minute', 'hour', 'day', 'week', 'month', 'year'])->default('day')->nullable(); $table->boolean('published')->default(true)->nullable(); + $table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null'); - - $table->timestamps(); + $table->softDeletes(); }); } diff --git a/database/migrations/2024_08_02_081908_create_isp_gateway_table.php b/database/migrations/2024_08_02_081908_create_isp_gateway_table.php index 345f803..f01fff3 100644 --- a/database/migrations/2024_08_02_081908_create_isp_gateway_table.php +++ b/database/migrations/2024_08_02_081908_create_isp_gateway_table.php @@ -23,7 +23,12 @@ public function up(): void $table->string('type'); $table->boolean('published')->nullable()->default(true); + $table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null'); + $table->timestamps(); + $table->softDeletes(); }); } diff --git a/database/migrations/2024_08_02_082115_create_isp_subscriber_login_table.php b/database/migrations/2024_08_02_082115_create_isp_subscriber_login_table.php index 13c09f4..fc87e11 100644 --- a/database/migrations/2024_08_02_082115_create_isp_subscriber_login_table.php +++ b/database/migrations/2024_08_02_082115_create_isp_subscriber_login_table.php @@ -26,7 +26,12 @@ public function up(): void $table->string('link_orig_esc')->nullable(); $table->string('mac_esc')->nullable(); + $table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null'); + $table->timestamps(); + $table->softDeletes(); }); } diff --git a/database/migrations/2024_08_03_082005_create_isp_package_table.php b/database/migrations/2024_08_03_082005_create_isp_package_table.php index 38881f0..6e09dc4 100644 --- a/database/migrations/2024_08_03_082005_create_isp_package_table.php +++ b/database/migrations/2024_08_03_082005_create_isp_package_table.php @@ -18,8 +18,8 @@ public function up(): void $table->string('slug'); $table->string('pool'); $table->string('description')->nullable(); - $table->foreignId('billing_cycle_id')->constrained('isp_billing_cycle')->onDelete('cascade')->nullable()->index('isp_package_billing_cycle_id'); - $table->foreignId('gateway_id')->constrained('isp_gateway')->onDelete('cascade')->nullable()->index('isp_package_gateway_id'); + $table->foreignId('billing_cycle_id')->nullable()->constrained('isp_billing_cycle')->onDelete('set null'); + $table->foreignId('gateway_id')->nullable()->constrained('isp_gateway')->onDelete('set null'); $table->string('speed')->nullable(); $table->enum('speed_type', ['gigabyte', 'kilobyte', 'megabyte'])->default('megabyte')->nullable(); $table->string('bundle')->nullable(); @@ -32,7 +32,12 @@ public function up(): void $table->boolean('is_hidden')->default(false)->nullable(); $table->decimal('amount', 8, 2)->nullable(); + $table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null'); + $table->timestamps(); + $table->softDeletes(); }); } diff --git a/database/migrations/2024_08_03_082019_create_isp_package_charge_table.php b/database/migrations/2024_08_03_082019_create_isp_package_charge_table.php index 98b77b8..72861db 100644 --- a/database/migrations/2024_08_03_082019_create_isp_package_charge_table.php +++ b/database/migrations/2024_08_03_082019_create_isp_package_charge_table.php @@ -16,14 +16,19 @@ public function up(): void $table->string('title'); $table->string('slug'); - $table->foreignId('package_id')->constrained('isp_package')->onDelete('cascade')->index('isp_package_charge_package_id'); - $table->foreignId('ledger_id')->constrained('account_ledger')->onDelete('cascade')->index('isp_package_charge_ledger_id'); + $table->foreignId('package_id')->nullable()->constrained('isp_package')->onDelete('set null'); + $table->foreignId('ledger_id')->nullable()->constrained('account_ledger')->onDelete('set null'); $table->tinyInteger('quantity')->default(1); $table->string('description')->nullable(); $table->double('price', 8, 2)->nullable(); $table->boolean('published')->default(true)->nullable(); + $table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null'); + $table->timestamps(); + $table->softDeletes(); }); } diff --git a/database/migrations/2024_08_03_082020_create_isp_package_charge_rate_table.php b/database/migrations/2024_08_03_082020_create_isp_package_charge_rate_table.php index dd1986e..c61b04b 100644 --- a/database/migrations/2024_08_03_082020_create_isp_package_charge_rate_table.php +++ b/database/migrations/2024_08_03_082020_create_isp_package_charge_rate_table.php @@ -14,11 +14,16 @@ public function up(): void Schema::create('isp_package_charge_rate', function (Blueprint $table) { $table->id(); - $table->foreignId('package_charge_id')->constrained('isp_package_charge')->onDelete('cascade')->index('isp_package_charge_rate_payment_charge_id'); - $table->foreignId('rate_id')->constrained('account_rate')->onDelete('cascade')->index('isp_package_charge_rate_rate_id'); + $table->foreignId('package_charge_id')->nullable()->constrained('isp_package_charge')->onDelete('set null'); + $table->foreignId('rate_id')->nullable()->constrained('account_rate')->onDelete('set null'); $table->boolean('published')->default(true)->nullable(); + $table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null'); + $table->timestamps(); + $table->softDeletes(); }); } diff --git a/database/migrations/2024_08_03_082024_create_isp_subscriber_table.php b/database/migrations/2024_08_03_082024_create_isp_subscriber_table.php index 0f05b00..6afe577 100644 --- a/database/migrations/2024_08_03_082024_create_isp_subscriber_table.php +++ b/database/migrations/2024_08_03_082024_create_isp_subscriber_table.php @@ -17,9 +17,14 @@ public function up(): void $table->string('username'); $table->string('password'); $table->boolean('had_trail')->default(0)->nullable(); - $table->foreignId('partner_id')->constrained('partner_partner')->onDelete('cascade')->nullable()->index('isp_subscriber_partner_id'); + $table->foreignId('partner_id')->nullable()->constrained('partner_partner')->onDelete('set null'); + + $table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null'); $table->timestamps(); + $table->softDeletes(); }); } diff --git a/database/migrations/2024_08_03_082025_create_isp_mac_address_table.php b/database/migrations/2024_08_03_082025_create_isp_mac_address_table.php index fd458fb..e0f26c9 100644 --- a/database/migrations/2024_08_03_082025_create_isp_mac_address_table.php +++ b/database/migrations/2024_08_03_082025_create_isp_mac_address_table.php @@ -14,10 +14,15 @@ public function up(): void Schema::create('isp_mac_address', function (Blueprint $table) { $table->id(); - $table->foreignId('subscriber_id')->constrained('isp_subscriber')->onDelete('cascade')->nullable()->index('isp_mac_address_subscriber_id'); + $table->foreignId('subscriber_id')->nullable()->constrained('isp_subscriber')->onDelete('set null'); $table->string('mac')->nullable(); + $table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null'); + $table->timestamps(); + $table->softDeletes(); }); } diff --git a/database/migrations/2024_08_03_082026_create_isp_subscription_table.php b/database/migrations/2024_08_03_082026_create_isp_subscription_table.php index ddc7874..df21125 100644 --- a/database/migrations/2024_08_03_082026_create_isp_subscription_table.php +++ b/database/migrations/2024_08_03_082026_create_isp_subscription_table.php @@ -14,12 +14,17 @@ public function up(): void Schema::create('isp_subscription', function (Blueprint $table) { $table->id(); - $table->foreignId('subscriber_id')->constrained('isp_subscriber')->onDelete('cascade')->index('isp_subscription_subscriber_id'); - $table->foreignId('package_id')->constrained('isp_package')->onDelete('cascade')->index('isp_subscription_package_id'); + $table->foreignId('subscriber_id')->nullable()->constrained('isp_subscriber')->onDelete('set null'); + $table->foreignId('package_id')->nullable()->constrained('isp_package')->onDelete('set null'); $table->datetime('start_date'); $table->datetime('end_date'); + $table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null'); + $table->timestamps(); + $table->softDeletes(); }); } diff --git a/database/migrations/2024_08_03_082037_create_isp_payment_table.php b/database/migrations/2024_08_03_082037_create_isp_payment_table.php index af096ad..c517563 100644 --- a/database/migrations/2024_08_03_082037_create_isp_payment_table.php +++ b/database/migrations/2024_08_03_082037_create_isp_payment_table.php @@ -15,14 +15,19 @@ public function up(): void $table->id(); $table->string('title'); - $table->foreignId('subscription_id')->constrained('isp_subscription')->onDelete('cascade')->nullable()->index('isp_payment_subscription_id'); - $table->foreignId('invoice_id')->constrained('account_invoice')->onDelete('cascade')->nullable()->index('isp_payment_invoice_id'); + $table->foreignId('subscription_id')->nullable()->constrained('isp_subscription')->onDelete('set null'); + $table->foreignId('invoice_id')->nullable()->constrained('account_invoice')->onDelete('set null'); $table->string('description')->nullable(); $table->boolean('is_paid')->default(0)->nullable(); $table->boolean('completed')->default(0)->nullable(); $table->boolean('successful')->default(0)->nullable(); + $table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null'); + $table->timestamps(); + $table->softDeletes(); }); } diff --git a/database/migrations/2024_08_03_082044_create_isp_payment_charge_table.php b/database/migrations/2024_08_03_082044_create_isp_payment_charge_table.php index 6d12db8..23fddef 100644 --- a/database/migrations/2024_08_03_082044_create_isp_payment_charge_table.php +++ b/database/migrations/2024_08_03_082044_create_isp_payment_charge_table.php @@ -16,14 +16,19 @@ public function up(): void $table->string('title'); $table->string('slug'); - $table->foreignId('payment_id')->constrained('isp_payment')->onDelete('cascade')->index('isp_payment_charge_payment_id'); - $table->foreignId('ledger_id')->constrained('account_ledger')->onDelete('cascade')->index('isp_payment_charge_ledger_id'); + $table->foreignId('payment_id')->nullable()->constrained('isp_payment')->onDelete('set null'); + $table->foreignId('ledger_id')->nullable()->constrained('account_ledger')->onDelete('set null'); $table->integer('quantity')->default(1); $table->string('description')->nullable(); $table->double('price', 8, 2)->nullable(); $table->boolean('published')->default(true)->nullable(); + $table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null'); + $table->timestamps(); + $table->softDeletes(); }); } diff --git a/database/migrations/2024_08_03_082050_create_isp_payment_charge_rate_table.php b/database/migrations/2024_08_03_082050_create_isp_payment_charge_rate_table.php index e0e3f2e..7f9c421 100644 --- a/database/migrations/2024_08_03_082050_create_isp_payment_charge_rate_table.php +++ b/database/migrations/2024_08_03_082050_create_isp_payment_charge_rate_table.php @@ -14,10 +14,15 @@ public function up(): void Schema::create('isp_payment_charge_rate', function (Blueprint $table) { $table->id(); - $table->foreignId('payment_charge_id')->constrained('isp_payment_charge')->onDelete('cascade')->index('payment_charge_id'); - $table->foreignId('rate_id')->constrained('account_rate')->onDelete('cascade')->index('rate_id'); + $table->foreignId('payment_charge_id')->nullable()->constrained('isp_payment_charge')->onDelete('set null'); + $table->foreignId('rate_id')->nullable()->constrained('account_rate')->onDelete('set null'); + + $table->foreignId('created_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('updated_by')->nullable()->constrained('users')->onDelete('set null'); + $table->foreignId('deleted_by')->nullable()->constrained('users')->onDelete('set null'); $table->timestamps(); + $table->softDeletes(); }); } diff --git a/database/migrations/2024_09_03_133219_add_deleted_at_to_isp_billing_cycle_table.php b/database/migrations/2024_09_03_133219_add_deleted_at_to_isp_billing_cycle_table.php deleted file mode 100644 index 2583528..0000000 --- a/database/migrations/2024_09_03_133219_add_deleted_at_to_isp_billing_cycle_table.php +++ /dev/null @@ -1,28 +0,0 @@ -softDeletes(); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::table('isp_billing_cycle', function (Blueprint $table) { - $table->dropColumn('deleted_at'); - }); - } -}; diff --git a/database/migrations/2024_09_03_133228_add_deleted_at_to_isp_gateway_table.php b/database/migrations/2024_09_03_133228_add_deleted_at_to_isp_gateway_table.php deleted file mode 100644 index 23f25e4..0000000 --- a/database/migrations/2024_09_03_133228_add_deleted_at_to_isp_gateway_table.php +++ /dev/null @@ -1,28 +0,0 @@ -softDeletes(); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::table('isp_gateway', function (Blueprint $table) { - $table->dropColumn('deleted_at'); - }); - } -}; diff --git a/database/migrations/2024_09_03_133240_add_deleted_at_to_isp_mac_address_table.php b/database/migrations/2024_09_03_133240_add_deleted_at_to_isp_mac_address_table.php deleted file mode 100644 index bbce17c..0000000 --- a/database/migrations/2024_09_03_133240_add_deleted_at_to_isp_mac_address_table.php +++ /dev/null @@ -1,28 +0,0 @@ -softDeletes(); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::table('isp_mac_address', function (Blueprint $table) { - $table->dropColumn('deleted_at'); - }); - } -}; diff --git a/database/migrations/2024_09_03_133251_add_deleted_at_to_isp_package_table.php b/database/migrations/2024_09_03_133251_add_deleted_at_to_isp_package_table.php deleted file mode 100644 index c1added..0000000 --- a/database/migrations/2024_09_03_133251_add_deleted_at_to_isp_package_table.php +++ /dev/null @@ -1,28 +0,0 @@ -softDeletes(); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::table('isp_package', function (Blueprint $table) { - $table->dropColumn('deleted_at'); - }); - } -}; diff --git a/database/migrations/2024_09_03_133257_add_deleted_at_to_isp_package_charge_table.php b/database/migrations/2024_09_03_133257_add_deleted_at_to_isp_package_charge_table.php deleted file mode 100644 index b8a6a1a..0000000 --- a/database/migrations/2024_09_03_133257_add_deleted_at_to_isp_package_charge_table.php +++ /dev/null @@ -1,28 +0,0 @@ -softDeletes(); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::table('isp_package_charge', function (Blueprint $table) { - $table->dropColumn('deleted_at'); - }); - } -}; diff --git a/database/migrations/2024_09_03_133311_add_deleted_at_to_isp_package_charge_rate_table.php b/database/migrations/2024_09_03_133311_add_deleted_at_to_isp_package_charge_rate_table.php deleted file mode 100644 index e2b9017..0000000 --- a/database/migrations/2024_09_03_133311_add_deleted_at_to_isp_package_charge_rate_table.php +++ /dev/null @@ -1,28 +0,0 @@ -softDeletes(); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::table('isp_package_charge_rate', function (Blueprint $table) { - $table->dropColumn('deleted_at'); - }); - } -}; diff --git a/database/migrations/2024_09_03_133321_add_deleted_at_to_isp_payment_table.php b/database/migrations/2024_09_03_133321_add_deleted_at_to_isp_payment_table.php deleted file mode 100644 index 5fe4da9..0000000 --- a/database/migrations/2024_09_03_133321_add_deleted_at_to_isp_payment_table.php +++ /dev/null @@ -1,28 +0,0 @@ -softDeletes(); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::table('isp_payment', function (Blueprint $table) { - $table->dropColumn('deleted_at'); - }); - } -}; diff --git a/database/migrations/2024_09_03_133340_add_deleted_at_to_isp_payment_charge_table.php b/database/migrations/2024_09_03_133340_add_deleted_at_to_isp_payment_charge_table.php deleted file mode 100644 index 01c77c5..0000000 --- a/database/migrations/2024_09_03_133340_add_deleted_at_to_isp_payment_charge_table.php +++ /dev/null @@ -1,28 +0,0 @@ -softDeletes(); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::table('isp_payment_charge', function (Blueprint $table) { - $table->dropColumn('deleted_at'); - }); - } -}; diff --git a/database/migrations/2024_09_03_133348_add_deleted_at_to_isp_payment_charge_rate_table.php b/database/migrations/2024_09_03_133348_add_deleted_at_to_isp_payment_charge_rate_table.php deleted file mode 100644 index 8434f6c..0000000 --- a/database/migrations/2024_09_03_133348_add_deleted_at_to_isp_payment_charge_rate_table.php +++ /dev/null @@ -1,28 +0,0 @@ -softDeletes(); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::table('isp_payment_charge_rate', function (Blueprint $table) { - $table->dropColumn('deleted_at'); - }); - } -}; diff --git a/database/migrations/2024_09_03_133406_add_deleted_at_to_isp_subscriber_table.php b/database/migrations/2024_09_03_133406_add_deleted_at_to_isp_subscriber_table.php deleted file mode 100644 index 593183c..0000000 --- a/database/migrations/2024_09_03_133406_add_deleted_at_to_isp_subscriber_table.php +++ /dev/null @@ -1,28 +0,0 @@ -softDeletes(); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::table('isp_subscriber', function (Blueprint $table) { - $table->dropColumn('deleted_at'); - }); - } -}; diff --git a/database/migrations/2024_09_03_133413_add_deleted_at_to_isp_subscriber_login_table.php b/database/migrations/2024_09_03_133413_add_deleted_at_to_isp_subscriber_login_table.php deleted file mode 100644 index e0ea585..0000000 --- a/database/migrations/2024_09_03_133413_add_deleted_at_to_isp_subscriber_login_table.php +++ /dev/null @@ -1,28 +0,0 @@ -softDeletes(); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::table('isp_subscriber_login', function (Blueprint $table) { - $table->dropColumn('deleted_at'); - }); - } -}; diff --git a/database/migrations/2024_09_03_133420_add_deleted_at_to_isp_subscription_table.php b/database/migrations/2024_09_03_133420_add_deleted_at_to_isp_subscription_table.php deleted file mode 100644 index 658a231..0000000 --- a/database/migrations/2024_09_03_133420_add_deleted_at_to_isp_subscription_table.php +++ /dev/null @@ -1,28 +0,0 @@ -softDeletes(); - }); - } - - /** - * Reverse the migrations. - */ - public function down(): void - { - Schema::table('isp_subscription', function (Blueprint $table) { - $table->dropColumn('deleted_at'); - }); - } -};