File manager - Edit - /home/linknsbh/sabel-eltaqwa.com/assets/lfm/files/shares/events/thumbs/migrations.zip
Back
PK B��\��[�~ ~ ; 2025_05_09_104218_add_partial_amount_to_purchases_table.phpnu �[��� <?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::table('purchases', function (Blueprint $table) { $table->double('partial_amount')->nullable()->after('paid_amount'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('purchases', function (Blueprint $table) { $table->dropColumn('partial_amount'); }); } }; PK B��\%#� . 2022_02_21_073634_create_permission_tables.phpnu �[��� <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; use Spatie\Permission\PermissionRegistrar; return new class extends Migration { /** * Run the migrations. */ public function up(): void { $tableNames = config('permission.table_names'); $columnNames = config('permission.column_names'); $teams = config('permission.teams'); if (empty($tableNames)) { throw new \Exception('Error: config/permission.php not loaded. Run [php artisan config:clear] and try again.'); } if ($teams && empty($columnNames['team_foreign_key'] ?? null)) { throw new \Exception('Error: team_foreign_key on config/permission.php not loaded. Run [php artisan config:clear] and try again.'); } Schema::create($tableNames['permissions'], function (Blueprint $table) { $table->bigIncrements('id'); $table->string('name'); // For MySQL 8.0 use string('name', 125); $table->string('guard_name')->default('web'); // For MySQL 8.0 use string('guard_name', 125); $table->timestamps(); // $table->unique(['name', 'guard_name']); }); Schema::create($tableNames['roles'], function (Blueprint $table) use ($teams, $columnNames) { $table->bigIncrements('id'); if ($teams || config('permission.testing')) { // permission.testing is a fix for sqlite testing $table->unsignedBigInteger($columnNames['team_foreign_key'])->nullable(); $table->index($columnNames['team_foreign_key'], 'roles_team_foreign_key_index'); } $table->string('name'); // For MySQL 8.0 use string('name', 125); $table->string('guard_name')->default('web'); // For MySQL 8.0 use string('guard_name', 125); $table->timestamps(); if ($teams || config('permission.testing')) { // $table->unique([$columnNames['team_foreign_key'], 'name', 'guard_name']); } else { // $table->unique(['name', 'guard_name']); } }); Schema::create($tableNames['model_has_permissions'], function (Blueprint $table) use ($tableNames, $columnNames, $teams) { $table->unsignedBigInteger(PermissionRegistrar::$pivotPermission); $table->string('model_type'); $table->unsignedBigInteger($columnNames['model_morph_key']); $table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_permissions_model_id_model_type_index'); $table->foreign(PermissionRegistrar::$pivotPermission) ->references('id') ->on($tableNames['permissions']) ->onDelete('cascade'); if ($teams) { $table->unsignedBigInteger($columnNames['team_foreign_key']); $table->index($columnNames['team_foreign_key'], 'model_has_permissions_team_foreign_key_index'); $table->primary([ $columnNames['team_foreign_key'], PermissionRegistrar::$pivotPermission, $columnNames['model_morph_key'], 'model_type', ], 'model_has_permissions_permission_model_type_primary'); } else { $table->primary([ PermissionRegistrar::$pivotPermission, $columnNames['model_morph_key'], 'model_type', ], 'model_has_permissions_permission_model_type_primary'); } }); Schema::create($tableNames['model_has_roles'], function (Blueprint $table) use ($tableNames, $columnNames, $teams) { $table->unsignedBigInteger(PermissionRegistrar::$pivotRole); $table->string('model_type'); $table->unsignedBigInteger($columnNames['model_morph_key']); $table->index([$columnNames['model_morph_key'], 'model_type'], 'model_has_roles_model_id_model_type_index'); $table->foreign(PermissionRegistrar::$pivotRole) ->references('id') ->on($tableNames['roles']) ->onDelete('cascade'); if ($teams) { $table->unsignedBigInteger($columnNames['team_foreign_key']); $table->index($columnNames['team_foreign_key'], 'model_has_roles_team_foreign_key_index'); $table->primary([ $columnNames['team_foreign_key'], PermissionRegistrar::$pivotRole, $columnNames['model_morph_key'], 'model_type', ], 'model_has_roles_role_model_type_primary'); } else { $table->primary([PermissionRegistrar::$pivotRole, $columnNames['model_morph_key'], 'model_type'], 'model_has_roles_role_model_type_primary'); } }); Schema::create($tableNames['role_has_permissions'], function (Blueprint $table) use ($tableNames) { $table->unsignedBigInteger(PermissionRegistrar::$pivotPermission); $table->unsignedBigInteger(PermissionRegistrar::$pivotRole); $table->foreign(PermissionRegistrar::$pivotPermission) ->references('id') ->on($tableNames['permissions']) ->onDelete('cascade'); $table->foreign(PermissionRegistrar::$pivotRole) ->references('id') ->on($tableNames['roles']) ->onDelete('cascade'); $table->primary([PermissionRegistrar::$pivotPermission, PermissionRegistrar::$pivotRole], 'role_has_permissions_permission_id_role_id_primary'); }); app('cache') ->store(config('permission.cache.store') != 'default' ? config('permission.cache.store') : null) ->forget(config('permission.cache.key')); } /** * Reverse the migrations. */ public function down(): void { $tableNames = config('permission.table_names'); if (empty($tableNames)) { throw new \Exception('Error: config/permission.php not found and defaults could not be merged. Please publish the package configuration before proceeding, or drop the tables manually.'); } Schema::drop($tableNames['role_has_permissions']); Schema::drop($tableNames['model_has_roles']); Schema::drop($tableNames['model_has_permissions']); Schema::drop($tableNames['roles']); Schema::drop($tableNames['permissions']); } }; PK B��\�Zl� * 2023_12_22_065227_fill_up_product_code.phpnu �[��� <?php use App\Models\Product; use Illuminate\Database\Migrations\Migration; return new class extends Migration { /** * Run the migrations. */ public function up(): void { $products = Product::where('product_code','')->get(); foreach ($products as $product) { $product->update([ 'product_code' => $product->code ]); } } /** * Reverse the migrations. */ public function down(): void { // } }; PK B��\2��\ : 2025_05_01_110910_create_stores_and_user_stores_tables.phpnu �[��� <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. */ public function up(): void { Artisan::call('db:seed', [ '--class' => 'StoreSeeder', '--force' => true, ]); } /** * Reverse the migrations. */ public function down(): void { // } }; PK B��\��`�H H 8 2022_10_17_052105_add_is_return_field_to_sales_table.phpnu �[��� <?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::table('sales', function (Blueprint $table) { $table->boolean('is_return')->default(0)->after('date'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('sales', function (Blueprint $table) { // }); } }; PK B��\*�=�L L # 2022_02_18_051026_create_brands.phpnu �[��� <?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('brands', function (Blueprint $table) { $table->id(); $table->string('tenant_id')->nullable(); $table->string('name'); $table->longText('description')->nullable(); $table->timestamps(); $table->foreign('tenant_id') ->references('id')->on('tenants') ->onUpdate('cascade') ->onDelete('cascade'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('brands'); } }; PK B��\l�I ( 2022_02_18_063507_create_media_table.phpnu �[��� <?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('media', function (Blueprint $table) { $table->bigIncrements('id'); $table->morphs('model'); $table->uuid('uuid')->nullable()->unique(); $table->string('collection_name'); $table->string('name'); $table->string('file_name'); $table->string('mime_type')->nullable(); $table->string('disk'); $table->string('conversions_disk')->nullable(); $table->unsignedBigInteger('size'); $table->json('manipulations'); $table->json('custom_properties'); $table->json('generated_conversions'); $table->json('responsive_images'); $table->unsignedInteger('order_column')->nullable()->index(); $table->nullableTimestamps(); }); } }; PK B��\%cCxx x , 2022_09_27_103942_add_new_field_in_sales.phpnu �[��� <?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::table('sales', function (Blueprint $table) { $table->boolean('is_sale_created')->default(false)->after('status'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('sales', function (Blueprint $table) { $table->dropColumn('is_sale_created'); }); } }; PK B��\��{W W 1 2022_05_10_104622_add_language_field_in_users.phpnu �[��� <?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::table('users', function (Blueprint $table) { $table->string('language')->default('en'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('users', function (Blueprint $table) { $table->dropColumn('language'); }); } }; PK B��\غ� � � , 2023_06_13_112717_add_pos_register_table.phpnu �[��� <?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('pos_register', function (Blueprint $table) { $table->id(); $table->double('cash_in_hand'); $table->datetime('closed_at')->nullable(); $table->double('cash_in_hand_while_closing')->nullable(); $table->double('bank_transfer')->nullable(); $table->double('cheque')->nullable(); $table->double('other')->nullable(); $table->double('total_sale')->nullable(); $table->double('total_return')->nullable(); $table->double('total_amount')->nullable(); $table->text('notes')->nullable(); $table->unsignedBigInteger('user_id'); $table->foreign('user_id') ->references('id')->on('users') ->onUpdate('cascade') ->onDelete('cascade'); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { // } }; PK B��\GJl�� � / 2023_07_07_064405_create_coupon_codes_table.phpnu �[��� <?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('coupon_codes', function (Blueprint $table) { $table->id(); $table->string('name'); $table->string('code')->unique(); $table->date('start_date'); $table->date('end_date'); $table->integer('how_many_time_can_use'); $table->integer('discount_type'); $table->double('discount'); $table->integer('how_many_time_used')->default(0); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('coupon_codes'); } }; PK B��\��;�+ + 5 2022_03_02_050637_create_product_categories_table.phpnu �[��� <?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('product_categories', function (Blueprint $table) { $table->id(); $table->string('tenant_id')->nullable(); $table->string('name'); $table->timestamps(); $table->foreign('tenant_id') ->references('id')->on('tenants') ->onUpdate('cascade') ->onDelete('cascade'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('product_categories'); } }; PK B��\<lT. . 5 2023_12_29_065039_fill_up_main_product_table_data.phpnu �[��� <?php use App\Models\MainProduct; use App\Models\Product; use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. */ public function up(): void { DB::beginTransaction(); $products = Product::with('variationProduct')->select('id','name','product_code','product_unit')->get(); foreach($products as $product){ $mainProduct = MainProduct::where('code',$product->product_code)->first(); if(!$mainProduct){ $mainProduct = new MainProduct(); $mainProduct->name = $product->name; $mainProduct->code = $product->product_code; $mainProduct->product_unit = $product->product_unit; $mainProduct->product_type = $product->variationProduct ? MainProduct::VARIATION_PRODUCT : MainProduct::SINGLE_PRODUCT; $mainProduct->save(); } $product->update([ 'main_product_id' => $mainProduct->id ]); if($product->variationProduct){ $product->variationProduct->update([ 'main_product_id' => $mainProduct->id ]); } } DB::commit(); } /** * Reverse the migrations. */ public function down(): void { // } }; PK B��\��qTv v B 2026_01_26_105522_change_two_factor_recovery_codes_to_longtext.phpnu �[��� <?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::table('users', function (Blueprint $table) { $table->longText('two_factor_recovery_codes') ->nullable() ->change(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('users', function (Blueprint $table) { // }); } }; PK B��\�p>v� � 9 2025_07_07_120230_run_generate_crud_permission_seeder.phpnu �[��� <?php use Illuminate\Support\Facades\Artisan; use Illuminate\Database\Migrations\Migration; return new class extends Migration { /** * Run the migrations. */ public function up(): void { Artisan::call('db:seed', ['--class' => 'GenerateCrudPermissionsSeeder', '--force' => true]); } /** * Reverse the migrations. */ public function down(): void { // } }; PK B��\��h? ? 7 2025_03_21_042555_add_is_default_to_multiple_tables.phpnu �[��� <?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 { $tables = ['product_categories', 'variations', 'brands', 'units', 'products', 'customers', 'users', 'suppliers', 'warehouses', 'mail_templates', 'sms_templates']; foreach ($tables as $table) { Schema::table($table, function (Blueprint $table) { $table->boolean('is_default')->default(false)->before('created_at'); }); } } /** * Reverse the migrations. */ public function down(): void { $tables = ['product_categories', 'variations', 'brands', 'units', 'products', 'customers', 'users', 'suppliers', 'warehouses', 'mail_templates', 'sms_templates']; foreach ($tables as $table) { Schema::table($table, function (Blueprint $table) { $table->dropColumn('is_default'); }); } } }; PK B��\n��� � , 2023_01_06_052856_create_languages_table.phpnu �[��� <?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('languages', function (Blueprint $table) { $table->id(); $table->string('name'); $table->string('iso_code', 191)->unique(); $table->boolean('is_default')->default(false); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('languages'); } }; PK B��\�-p�� � >