Файловый менеджер - Редактировать - /home/clickysoft/public_html/jmapi5.clickysoft.net/migrations.tar
Назад
2023_05_17_121833_add_cheque_number_column_to_orders_table.php 0000644 00000001177 15021221741 0017616 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table) { $table->string('cheque_number')->nullable()->after('payment_type'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('orders', function (Blueprint $table) { // }); } }; 2022_12_13_143349_create_carts_table.php 0000644 00000001603 15021221741 0013157 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('carts', function (Blueprint $table) { $table->id(); $table->integer('user_id'); $table->integer('product_id'); $table->integer('attribute_id'); $table->integer('attribute_option_id'); $table->integer('quantity'); $table->text('customization')->nullable(); $table->string('attachment')->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('carts'); } }; 2022_12_22_073843_create_purchase_order_items_table.php 0000644 00000001421 15021221741 0016250 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('purchase_order_items', function (Blueprint $table) { $table->id(); $table->integer('order_item_id'); $table->integer('product_id'); $table->integer('attribute_id'); $table->integer('attribute_option_id'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('purchase_order_items'); } }; 2024_04_19_115201_alter_users_table.php 0000644 00000001174 15021221741 0013046 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('users', function (Blueprint $table) { $table->string('secondary_name')->after('birth_date')->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('users', function (Blueprint $table) { // }); } }; 2023_10_23_120950_change_column_type_in_product_prices_table.php 0000644 00000001447 15021221741 0020155 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('product_prices', function (Blueprint $table) { $table->decimal("shipping_weight", 15, 3)->change(); $table->decimal("length", 15, 3)->change(); $table->decimal("width", 15, 3)->change(); $table->decimal("height", 15, 3)->change(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('product_prices', function (Blueprint $table) { // }); } }; 2023_03_16_082740_alter_contact_queries_table.php 0000644 00000001211 15021221741 0015073 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('contact_queries', function (Blueprint $table) { $table->bigInteger('location_id')->nullable()->after('id'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('contact_queries', function (Blueprint $table) { // }); } }; 2023_04_10_111806_alter_orders_table.php 0000644 00000001167 15021221741 0013202 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table) { $table->decimal('sales_tax_amount')->after('state_sales_tax'); $table->decimal('rush_order_amount')->after('rush_order_fee'); }); } /** * Reverse the migrations. * * @return void */ public function down() { // } }; 2022_11_28_000014_create_role_user_pivot_table.php 0000644 00000001171 15021221741 0015245 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateRoleUserPivotTable extends Migration { public function up() { Schema::create('role_user', function (Blueprint $table) { $table->unsignedBigInteger('user_id'); $table->foreign('user_id', 'user_id_fk_7675408')->references('id')->on('users')->onDelete('cascade'); $table->unsignedBigInteger('role_id'); $table->foreign('role_id', 'role_id_fk_7675408')->references('id')->on('roles')->onDelete('cascade'); }); } } 2023_06_02_171741_create_order_artwork_reminders_table.php 0000644 00000002205 15021221741 0016775 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { public function up() { DB::statement($this->dropView()); DB::statement($this->createView()); } private function createView(): string { return "CREATE VIEW order_artwork_reminders AS SELECT o.id AS order_id, o.user_id, o.order_number, o.current_status_id, os.notes, o.created_at, o.updated_at FROM orders o LEFT JOIN users ON users.id = o.user_id LEFT JOIN order_status os ON os.status_id = o.current_status_id AND os.order_id = o.id WHERE o.current_status_id = 8 AND o.updated_at <= DATE_SUB(NOW(), INTERVAL 8 HOUR);"; } private function dropView(): string { return "DROP VIEW IF EXISTS `order_artwork_reminders`;"; } }; 2023_01_23_142021_alter_reviews_table.php 0000644 00000001043 15021221741 0013353 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('reviews', function (Blueprint $table) { $table->bigInteger('order_id')->after('product_id'); }); } /** * Reverse the migrations. * * @return void */ public function down() { // } }; 2022_12_15_144838_create_our_partners_table.php 0000644 00000001243 15021221741 0014574 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('our_partners', function (Blueprint $table) { $table->id(); $table->string('title'); $table->tinyInteger('status')->default(1); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('our_partners'); } }; 2023_09_05_165314_add_sketch_file_column_in_order_items_table.php 0000644 00000001206 15021221741 0020252 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('order_items', function (Blueprint $table) { $table->text('sketch_file')->after('customization')->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('order_items', function (Blueprint $table) { // }); } }; 2023_03_14_082303_alter_order_table.php 0000644 00000001244 15021221741 0013015 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table) { $table->date('date_scheduled')->nullable(); $table->date('date_pick_or_ship_by')->nullable(); $table->bigInteger('stock_location_id')->nullable()->unsigned(); }); } /** * Reverse the migrations. * * @return void */ public function down() { // } }; 2024_05_22_233310_add_column_is_residential_in_orders_table.php 0000644 00000001214 15021221741 0017735 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table) { $table->boolean('is_residential')->default(false)->after('shipping_address_id'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('orders', function (Blueprint $table) { // }); } }; 2022_11_28_000006_create_products_table.php 0000644 00000002314 15021221741 0013671 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateProductsTable extends Migration { public function up() { Schema::create('products', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('vendor_id')->nullable(); $table->string('sku')->unique(); $table->string('name'); $table->string('slug')->unique(); $table->string('description')->nullable(); $table->string('supplier_prod_number')->nullable(); $table->string('shipping_weight')->nullable()->comment('Weight Unit is Pounds (lbs)'); $table->decimal('vendor_price')->nullable(); $table->decimal('retail_price')->nullable(); $table->tinyInteger('engraving')->nullable(); $table->tinyInteger('color_engraving')->nullable(); $table->decimal('price_from')->nullable(); $table->decimal('price_to')->nullable(); $table->string('product_sketch')->nullable(); $table->tinyInteger('status')->default(1); $table->timestamps(); }); } } 2023_12_05_174528_alter_order_artwork_reminders_table.php 0000644 00000002064 15021221741 0016652 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { public function up() { DB::statement($this->dropView()); DB::statement($this->createView()); } private function createView(): string { return "CREATE VIEW order_artwork_reminders AS SELECT o.id AS order_id, o.user_id, o.order_number, o.current_status_id, (SELECT os.notes FROM order_status os WHERE os.status_id = o.current_status_id AND os.order_id = o.id LIMIT 1) AS notes, o.created_at, o.updated_at FROM orders o LEFT JOIN users ON users.id = o.user_id WHERE o.current_status_id = 6;"; } private function dropView(): string { return "DROP VIEW IF EXISTS `order_artwork_reminders`;"; } }; 2023_11_09_145330_alter_phone_number_column_in_address_books_table.php 0000644 00000001177 15021221741 0021340 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('address_books', function (Blueprint $table) { $table->string('phone_number')->nullable()->change(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('address_books', function (Blueprint $table) { // }); } }; 2022_11_28_000019_add_relationship_fields_to_address_books_table.php 0000644 00000000733 15021221741 0020755 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class AddRelationshipFieldsToAddressBooksTable extends Migration { public function up() { Schema::table('address_books', function (Blueprint $table) { $table->unsignedBigInteger('user_id')->nullable(); $table->foreign('user_id', 'user_fk_7675599')->references('id')->on('users'); }); } } 2023_07_07_132352_add_payment_date_colunm_to_orders_table.php 0000644 00000001203 15021221741 0017433 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table) { $table->timestamp('payment_date')->nullable()->after('payment_status'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('orders', function (Blueprint $table) { // }); } }; 2023_06_13_070647_add_sort_column_to_statuses_table.php 0000644 00000001164 15021221741 0016337 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('statuses', function (Blueprint $table) { $table->integer('sort')->nullable()->after('color'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('statuses', function (Blueprint $table) { // }); } }; 2023_07_07_135532_alter_report_sales_table.php 0000644 00000002447 15021221741 0014423 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { public function up() { DB::statement($this->dropView()); DB::statement($this->createView()); } private function createView(): string { return "CREATE VIEW report_sales AS (SELECT o.order_number, o.payment_status, o.payment_date AS `date`, o.waive_off_sales_tax, o.items_total, o.rush_order_fee, o.sales_tax_amount, o.shipping_charges, CASE WHEN o.waive_off_sales_tax = 0 THEN COALESCE (o.items_total, 0) + COALESCE (o.rush_order_fee, 0) + COALESCE (o.sales_tax_amount, 0) + COALESCE (o.shipping_charges, 0) ELSE COALESCE (o.items_total, 0) + COALESCE (o.rush_order_fee, 0) + COALESCE (o.shipping_charges, 0) END AS amount FROM orders o WHERE o.payment_status = 'Paid');"; } private function dropView(): string { return <<<SQL DROP VIEW IF EXISTS `report_sales`; SQL; } }; 2022_12_12_100411_create_store_locations_table.php 0000644 00000001402 15021221741 0015225 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('store_locations', function (Blueprint $table) { $table->id(); $table->string('title'); $table->string('address'); $table->string('latitude')->nullable(); $table->string('longitude')->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('store_locations'); } }; 2022_12_07_104441_create_state_sales_taxes_table.php 0000644 00000001265 15021221741 0015553 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('state_sales_taxes', function (Blueprint $table) { $table->id(); $table->string('name')->unique(); $table->decimal('tax_percentage', 10, 4); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('state_sales_taxes'); } }; 2023_01_31_104329_add_rush_order_fee_to_orders_table.php 0000644 00000001220 15021221741 0016370 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table) { $table->decimal('rush_order_fee')->nullable()->comment('Rush order fee percentage'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('orders', function (Blueprint $table) { // }); } }; 2023_12_04_155011_alter_orders_table.php 0000644 00000001735 15021221741 0013201 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table) { $table->unsignedBigInteger('coupon_id')->nullable()->after('pickup_location_id'); $table->string('discount_type')->nullable()->after('resale_number'); $table->decimal('discount_value')->nullable()->after('discount_type'); $table->decimal('discount_total')->nullable()->after('discount_value') ->comment('The amount that will deducted from order total as discount'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('orders', function (Blueprint $table) { // }); } }; 2023_03_16_151007_alter_purchase_orders_table.php 0000644 00000002270 15021221741 0015072 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('purchase_orders', function (Blueprint $table) { $table->bigInteger('ordered_by_id')->unsigned()->after('id'); $table->string('payment_terms')->nullable()->after('order_number'); $table->string('reference')->nullable()->after('payment_terms'); $table->text('special_notes')->nullable()->after('reference'); $table->text('shipping_address')->nullable()->after('special_notes'); $table->text('billing_address')->nullable()->after('shipping_address'); $table->text('shipping_speed')->nullable()->after('billing_address'); $table->bigInteger('stock_location_id')->nullable()->unsigned(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('purchase_orders', function (Blueprint $table) { // }); } }; 2023_12_07_170724_create_office_supplies_table.php 0000644 00000001544 15021221741 0015227 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('office_supplies', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('vendor_id'); $table->string('name'); $table->string('sku')->unique(); $table->text('description')->nullable(); $table->decimal('price'); $table->boolean('status')->default(true); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('office_supplies'); } }; 2023_03_07_105823_alter_contact_queries_table.php 0000644 00000001207 15021221741 0015076 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('contact_queries', function (Blueprint $table) { $table->string('department')->nullable()->after('phone'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('contact_queries', function (Blueprint $table) { // }); } }; 2023_04_11_201357_create_report_jobs_completed_table.php 0000644 00000001377 15021221741 0016431 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { public function up() { DB::statement($this->dropView()); DB::statement($this->createView()); } private function createView(): string { return "CREATE VIEW report_jobs_completed AS (SELECT orders.id, orders.order_number, orders.updated_at AS date FROM orders JOIN statuses ON orders.current_status_id = statuses.id WHERE statuses.name = 'Complete/Customer Notified');"; } private function dropView(): string { return <<<SQL DROP VIEW IF EXISTS `report_jobs_completed`; SQL; } }; 2023_03_09_114029_add_state_rate_to_orders_table.php 0000644 00000001520 15021221741 0015540 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table) { $table->decimal('state_sales_tax') ->comment('State sales tax percentage to be applied on order.'); $table->boolean('waive_off_sales_tax')->default(0)->nullable() ->comment('For government organization sales tax can be waived off'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('orders', function (Blueprint $table) { // }); } }; 2023_01_18_134733_add_notes_column_to_order_status_table.php 0000644 00000001176 15021221741 0017343 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('order_status', function (Blueprint $table) { $table->text('notes')->nullable()->after('status_id'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('order_status', function (Blueprint $table) { // }); } }; 2023_04_03_112753_create_products_imports_table.php 0000644 00000001355 15021221741 0015463 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('products_imports', function (Blueprint $table) { $table->id(); $table->bigInteger('imported_by_id')->unsigned(); $table->string('status'); $table->dateTime('completed_at')->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('products_imports'); } }; 2022_11_28_000003_create_roles_table.php 0000644 00000000637 15021221741 0013155 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateRolesTable extends Migration { public function up() { Schema::create('roles', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('title')->nullable(); $table->timestamps(); }); } } 2022_12_12_082219_create_vendors_table.php 0000644 00000001253 15021221741 0013521 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('vendors', function (Blueprint $table) { $table->id(); $table->string('name'); $table->string('email'); $table->string('phone'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('vendors'); } }; 2022_11_28_000013_create_permission_role_pivot_table.php 0000644 00000001235 15021221741 0016457 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreatePermissionRolePivotTable extends Migration { public function up() { Schema::create('permission_role', function (Blueprint $table) { $table->unsignedBigInteger('role_id'); $table->foreign('role_id', 'role_id_fk_7675399')->references('id')->on('roles')->onDelete('cascade'); $table->unsignedBigInteger('permission_id'); $table->foreign('permission_id', 'permission_id_fk_7675399')->references('id')->on('permissions')->onDelete('cascade'); }); } } 2023_01_05_132844_create_purchase_order_details_table.php 0000644 00000001407 15021221741 0016555 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('purchase_order_details', function (Blueprint $table) { $table->id(); $table->integer('purchase_order_id'); $table->integer('product_id'); $table->integer('quantity'); $table->decimal('price'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('purchase_order_details'); } }; 2023_05_03_102909_add_booking_number_to_orders_table.php 0000644 00000001217 15021221741 0016410 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table) { $table->string('book_number')->nullable()->comment('WebShip shipment book number'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('orders', function (Blueprint $table) { // }); } }; 2023_03_14_094359_create_stock_locations_table.php 0000644 00000001250 15021221741 0015247 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('stock_locations', function (Blueprint $table) { $table->id(); $table->string('location'); $table->boolean('status')->default(1); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('stock_locations'); } }; 2023_06_02_122029_add_reminder_duration_column_to_users_table.php 0000644 00000001353 15021221741 0020336 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('users', function (Blueprint $table) { $table->integer('reminder_duration')->nullable()->default(10) ->comment('This column will be used to send email reminders to users for order pending payments.'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('users', function (Blueprint $table) { // }); } }; 2023_04_18_024036_create_temp_product_urls_table.php 0000644 00000001343 15021221741 0015614 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('temp_product_urls', function (Blueprint $table) { $table->id(); $table->bigInteger('model_id')->unsigned(); $table->enum('type', ['sketch', 'image']); $table->string('url'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('temp_product_urls'); } }; 2024_06_25_012127_add_column_user_id_in_order_status_table.php 0000644 00000001216 15021221741 0017620 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('order_status', function (Blueprint $table) { $table->unsignedBigInteger('user_id')->after('status_id')->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('order_status', function (Blueprint $table) { // }); } }; 2023_06_09_174702_add_tracking_number_column_to_orders_table.php 0000644 00000001200 15021221741 0020136 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table) { $table->string('tracking_number')->nullable()->after('book_number'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('orders', function (Blueprint $table) { // }); } }; 2023_01_04_135038_alter_purchase_order_items_table.php 0000644 00000001044 15021221741 0016107 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('purchase_order_items', function (Blueprint $table){ $table->integer('order_id')->after('id'); }); } /** * Reverse the migrations. * * @return void */ public function down() { // } }; 2022_11_30_084531_add_password_reset_code_field_to_users_table.php 0000644 00000001347 15021221741 0020454 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('users', function (Blueprint $table) { $table->string('password_reset_code')->after('remember_token')->nullable(); $table->timestamp('password_last_changed')->after('password_reset_code')->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('users', function (Blueprint $table) { // }); } }; 2023_02_13_092512_create_failed_jobs_table.php 0000644 00000001452 15021221741 0014301 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('failed_jobs', function (Blueprint $table) { $table->id(); $table->string('uuid')->unique(); $table->text('connection'); $table->text('queue'); $table->longText('payload'); $table->longText('exception'); $table->timestamp('failed_at')->useCurrent(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('failed_jobs'); } }; 2022_12_22_104304_create_purchase_orders_table.php 0000644 00000002005 15021221741 0015214 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('purchase_orders', function (Blueprint $table) { $table->id(); $table->integer('vendor_id'); $table->integer('product_id'); $table->integer('attribute_id'); $table->integer('attribute_option_id'); $table->integer('quantity'); $table->decimal('price'); $table->string('status')->default('Pending') ->comment('Pending/Completed. This status show that the products have been received from vendor or not'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('purchase_orders'); } }; 2023_01_04_110315_drop_columns_from_carts_table.php 0000644 00000001224 15021221741 0015424 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('carts', function (Blueprint $table) { $table->dropColumn('attribute_id'); $table->dropColumn('attribute_option_id'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('carts', function (Blueprint $table) { // }); } }; 2023_01_13_143248_create_product_variation_table.php 0000644 00000001546 15021221741 0015602 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('product_variations', function (Blueprint $table) { $table->id(); $table->bigInteger('product_id')->unsigned(); $table->bigInteger('variation_id')->unsigned(); $table->timestamps(); $table->foreign('product_id')->references('id')->on('products'); $table->foreign('variation_id')->references('id')->on('variations'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('product_variation'); } }; 2022_11_28_000015_add_relationship_fields_to_categories_table.php 0000644 00000000741 15021221741 0020253 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class AddRelationshipFieldsToCategoriesTable extends Migration { public function up() { Schema::table('categories', function (Blueprint $table) { $table->unsignedBigInteger('parent_id')->nullable(); $table->foreign('parent_id', 'parent_fk_7675456')->references('id')->on('categories'); }); } } 2024_06_12_045129_add_column_po_created_in_order_items_table.php 0000644 00000001164 15021221741 0020077 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('order_items', function (Blueprint $table) { $table->boolean('po_created')->default(false); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('order_items', function (Blueprint $table) { // }); } }; 2023_01_19_104457_add_deleted_by_user_column_to_orders_table.php 0000644 00000001213 15021221741 0020122 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table) { $table->boolean('deleted_by_user')->after('shipping_phone_number')->default(0); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('orders', function (Blueprint $table) { // }); } }; 2024_06_28_045826_add_column_is_read_in_contact_queries_table.php 0000644 00000001213 15021221741 0020262 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('contact_queries', function (Blueprint $table) { $table->boolean('is_read')->default(false)->after('message'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('contact_queries', function (Blueprint $table) { // }); } }; 2023_05_07_092750_add_notes_column_to_order_items_table.php 0000644 00000001200 15021221741 0017131 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('order_items', function (Blueprint $table) { $table->text('notes')->nullable()->after('customization'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('order_items', function (Blueprint $table) { // }); } }; 2023_05_22_130305_alter_ordes_table_change_shipping_charges_column.php 0000644 00000001416 15021221741 0021273 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table) { $table->dropColumn('shipping_charges'); }); Schema::table('orders', function (Blueprint $table) { $table->decimal('shipping_charges', 10, 2)->nullable()->after('package_type_code'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('orders', function (Blueprint $table) { // }); } }; 2023_05_10_131306_alter_purchase_order_to_create_table.php 0000644 00000001522 15021221741 0016727 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('purchase_order_to_create', function (Blueprint $table) { $table->dropColumn('order_id'); $table->unsignedBigInteger('product_id')->after('id'); $table->unsignedBigInteger('price_id')->after('product_id'); $table->unsignedBigInteger('quantity')->after('price_id'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('purchase_order_to_create', function (Blueprint $table) { // }); } }; 2023_01_16_090356_add_has_variations_column_to_products_table.php 0000644 00000001174 15021221741 0020350 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('products', function (Blueprint $table) { $table->boolean('has_variations')->after('color_engraving'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('products', function (Blueprint $table) { // }); } }; 2022_12_13_080523_create_site_settings_table.php 0000644 00000001221 15021221741 0014715 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('site_settings', function (Blueprint $table) { $table->id(); $table->string('key'); $table->string('value'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('site_settings'); } }; 2023_09_05_144741_alter_customization_field_to_lontext_in_order_items_table.php 0000644 00000001175 15021221741 0023334 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('order_items', function (Blueprint $table) { $table->longText('customization')->change(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('lontext_in_order_items', function (Blueprint $table) { // }); } }; 2023_01_31_091714_add_pickup_location_id_to_orders_table.php 0000644 00000001232 15021221741 0017242 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table) { $table->bigInteger('pickup_location_id')->unsigned()->nullable()->after('billing_address_id'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('orders', function (Blueprint $table) { // }); } }; 2023_05_22_144711_add_payment_id_to_orders_table.php 0000644 00000001151 15021221741 0015534 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table) { $table->bigInteger('payment_id')->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('orders', function (Blueprint $table) { // }); } }; 2023_07_13_145006_create_coupons_table.php 0000644 00000001615 15021221741 0013531 0 ustar 00 <?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('coupons', function (Blueprint $table) { $table->id(); $table->string('code', 190); $table->enum('discount_type', ['Percent', 'Fixed']); $table->decimal('discount_value'); $table->date('expiry_date')->nullable(); $table->integer('number_of_usage')->nullable(); $table->integer('redemption_count')->nullable(); $table->boolean('status')->default(1); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('coupons'); } }; 2023_03_07_112209_alter_order_status_table.php 0000644 00000001135 15021221741 0014420 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('order_status', function (Blueprint $table) { $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('order_status', function (Blueprint $table) { // }); } }; 2023_01_31_083904_add_cancelation_charges_to_orders_table.php 0000644 00000001235 15021221741 0017364 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table) { $table->decimal('cancellation_charges')->nullable()->comment('Cancellation charges percentage.'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('orders', function (Blueprint $table) { // }); } }; 2023_03_17_165728_alter_order_items_table.php 0000644 00000001335 15021221741 0014237 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('order_items', function (Blueprint $table) { $table->boolean('purchase_order_status')->nullable() ->comment('1 => Product ordered, 2 => Product received, Null => Not ordered yet'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('order_items', function (Blueprint $table) { // }); } }; 2022_11_28_000009_create_attribute_options_table.php 0000644 00000000663 15021221741 0015614 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateAttributeOptionsTable extends Migration { public function up() { Schema::create('attribute_options', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('name')->unique(); $table->timestamps(); }); } } 2023_01_03_092614_drop_columns_from_order_items_table.php 0000644 00000001505 15021221741 0016640 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('order_items', function (Blueprint $table) { $table->dropColumn('attribute_id'); $table->dropColumn('attribute_name'); $table->dropColumn('attribute_option_id'); $table->dropColumn('attribute_option_name'); $table->dropColumn('attribute_option_price'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('order_items', function (Blueprint $table) { // }); } }; 2022_11_28_000004_create_users_table.php 0000644 00000001520 15021221741 0013163 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateUsersTable extends Migration { public function up() { Schema::create('users', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('name'); $table->string('email')->unique(); $table->datetime('email_verified_at')->nullable(); $table->string('password')->nullable(); $table->string('phone_number')->nullable()->nullable(); $table->string('remember_token')->nullable(); $table->string('user_type')->nullable()->comment("1 = Admin, 2 = Employee, 3 = Customer"); $table->tinyInteger('status')->default(1); $table->timestamps(); }); } } 2022_12_09_141852_create_order_status_table.php 0000644 00000001144 15021221741 0014563 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('order_status', function (Blueprint $table) { $table->bigInteger('order_id'); $table->bigInteger('status_id'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('order_status'); } }; 2023_12_01_075540_add_sku_column_to_variations_table.php 0000644 00000001166 15021221741 0016447 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('variations', function (Blueprint $table) { $table->string('sku')->nullable()->after('value'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('variations', function (Blueprint $table) { // }); } }; 2022_11_28_000020_add_relationship_fields_to_orders_table.php 0000644 00000002275 15021221741 0017424 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class AddRelationshipFieldsToOrdersTable extends Migration { public function up() { Schema::table('orders', function (Blueprint $table) { $table->unsignedBigInteger('user_id')->nullable(); $table->foreign('user_id', 'user_fk_7675914')->references('id')->on('users'); $table->unsignedBigInteger('current_status_id')->nullable(); $table->foreign('current_status_id', 'current_status_fk_7675930')->references('id')->on('statuses'); $table->unsignedBigInteger('assigned_to_id')->nullable(); $table->foreign('assigned_to_id', 'assigned_to_fk_7675916')->references('id')->on('users'); $table->unsignedBigInteger('shipping_address_id')->nullable(); $table->foreign('shipping_address_id', 'shipping_address_fk_7675918')->references('id')->on('address_books'); $table->unsignedBigInteger('billing_address_id')->nullable(); $table->foreign('billing_address_id', 'billing_address_fk_7675919')->references('id')->on('address_books'); }); } } 2023_03_03_184822_alter_products_table.php 0000644 00000001224 15021221741 0013552 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('products', function (Blueprint $table) { $table->dropColumn('description'); }); Schema::table('products', function (Blueprint $table) { $table->text('description')->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { // } }; 2023_06_02_115018_add_grand_total_column_to_orders_table.php 0000644 00000001202 15021221741 0017250 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table) { $table->decimal('grand_total')->after('sales_tax_amount')->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('orders', function (Blueprint $table) { // }); } }; 2023_01_13_093410_create_variations_table.php 0000644 00000001311 15021221741 0014206 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('variations', function (Blueprint $table) { $table->id(); $table->string('type'); $table->string('value')->unique(); $table->boolean('status')->default(1); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('variations'); } }; 2023_05_29_102352_add_order_id_column_to_purchase_order_to_create_table.php 0000644 00000001224 15021221741 0022306 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('purchase_order_to_create', function (Blueprint $table) { $table->unsignedBigInteger('order_id')->after('id'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('purchase_order_to_create', function (Blueprint $table) { // }); } }; 2023_03_09_101849_alter_store_locations_table.php 0000644 00000001331 15021221741 0015121 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('store_locations', function (Blueprint $table) { $table->bigInteger('state_id')->unsigned()->nullable()->after('id'); $table->boolean('status')->after('longitude')->default(1); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('store_locations', function (Blueprint $table) { // }); } }; 2023_03_15_090112_alter_products_table.php 0000644 00000001155 15021221741 0013544 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('products', function (Blueprint $table) { $table->decimal('engraving_fee')->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('products', function (Blueprint $table) { // }); } }; 2023_01_23_133217_alter_carts_table.php 0000644 00000001055 15021221741 0013015 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('carts', function (Blueprint $table) { $table->bigInteger('price_id')->unsigned()->after('product_id'); }); } /** * Reverse the migrations. * * @return void */ public function down() { // } }; 2023_01_26_134231_alter_users_table.php 0000644 00000001277 15021221741 0013050 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('users', function (Blueprint $table) { $table->string('company')->after('phone_number')->nullable(); $table->string('fax_number')->after('company')->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('users', function (Blueprint $table) { // }); } }; 2023_02_10_151808_create_jobs_table.php 0000644 00000001530 15021221741 0012773 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('jobs', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('queue')->index(); $table->longText('payload'); $table->unsignedTinyInteger('attempts'); $table->unsignedInteger('reserved_at')->nullable(); $table->unsignedInteger('available_at'); $table->unsignedInteger('created_at'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('jobs'); } }; 2024_05_08_234625_create_order_partial_payments_table.php 0000644 00000001757 15021221741 0016632 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('order_partial_payments', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('order_id'); $table->unsignedBigInteger('charged_by_id'); $table->unsignedBigInteger('payment_id')->nullable(); $table->string('payment_type'); $table->string('cheque_number')->nullable(); $table->string('purchase_order_number')->nullable(); $table->string('purchase_order_copy')->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('order_partial_payments'); } }; 2023_01_04_101924_create_cart_items_table.php 0000644 00000001314 15021221741 0014164 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('cart_items', function (Blueprint $table) { $table->id(); $table->integer('cart_id'); $table->integer('attribute_id'); $table->integer('attribute_option_id'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('cart_items'); } }; 2022_11_28_000012_create_statuses_table.php 0000644 00000000642 15021221741 0013700 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateStatusesTable extends Migration { public function up() { Schema::create('statuses', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('name')->unique(); $table->timestamps(); }); } } 2023_01_13_143414_create_product_variation_price_ranges_table.php 0000644 00000002007 15021221741 0020307 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('product_variation_price_ranges', function (Blueprint $table) { $table->id(); $table->bigInteger('product_id')->unsigned(); $table->bigInteger('product_price_id')->unsigned(); $table->integer('qty_from'); $table->integer('qty_to'); $table->double('price', 15, 2); $table->timestamps(); $table->foreign('product_id')->references('id')->on('products'); $table->foreign('product_price_id')->references('id')->on('product_prices'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('product_variation_price_ranges'); } }; 2022_11_28_000018_add_relationship_fields_to_attribute_options_table.php 0000644 00000000767 15021221741 0021717 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class AddRelationshipFieldsToAttributeOptionsTable extends Migration { public function up() { Schema::table('attribute_options', function (Blueprint $table) { $table->unsignedBigInteger('attribute_id')->nullable(); $table->foreign('attribute_id', 'attribute_fk_7675571')->references('id')->on('attributes'); }); } } 2023_01_19_105327_create_purchase_order_to_create_table.php 0000644 00000001227 15021221741 0017076 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('purchase_order_to_create', function (Blueprint $table) { $table->id(); $table->bigInteger('order_id')->unsigned(); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('purchase_order_to_create'); } }; 2023_12_07_121951_alter_coupons__table.php 0000644 00000001401 15021221741 0013527 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('coupons', function (Blueprint $table) { $table->dropColumn('discount_type'); }); Schema::table('coupons', function (Blueprint $table) { $table->enum('discount_type', ['percentage', 'fixed'])->after('code'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('coupons', function (Blueprint $table) { // }); } }; 2023_01_02_105912_alter_orders_table.php 0000644 00000001174 15021221741 0013177 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table) { $table->string('delivery_type')->nullable()->after('event_date'); $table->text('description')->nullable()->after('delivery_type'); }); } /** * Reverse the migrations. * * @return void */ public function down() { // } }; 2023_04_10_145923_create_report_sales_tax_view_table.php 0000644 00000001304 15021221741 0016450 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { public function up() { DB::statement($this->dropView()); DB::statement($this->createView()); } private function createView(): string { return <<<SQL CREATE VIEW `report_sales_tax` AS (SELECT id, DATE_FORMAT(`created_at`, '%Y-%m-%d') AS date, sales_tax_amount as amount FROM orders WHERE current_status_id > 1) SQL; } private function dropView(): string { return <<<SQL DROP VIEW IF EXISTS `report_sales_tax`; SQL; } }; 2023_01_13_140738_alter_product_prices_table.php 0000644 00000002105 15021221741 0014730 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('product_prices', function (Blueprint $table) { $table->dropColumn('qty_from'); $table->dropColumn('qty_to'); $table->dropColumn('price'); $table->double('vendor_price', 15, 2); $table->string('supplier_prod_number'); $table->double('shipping_weight'); $table->double('base_price', 15, 2)->nullable(); $table->double('min_price', 15, 2)->nullable(); $table->double('max_price', 15, 2)->nullable(); $table->double('avg_price', 15, 2)->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('product_prices', function (Blueprint $table) { // }); } }; 2023_01_30_140105_create_order_notes_table.php 0000644 00000001326 15021221741 0014351 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('order_notes', function (Blueprint $table) { $table->id(); $table->bigInteger('user_id')->unsigned(); $table->bigInteger('order_id')->unsigned(); $table->text('note'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('order_notes'); } }; 2024_07_09_000359_add_column_pickup_by_in_orders_table.php 0000644 00000001176 15021221741 0016747 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table) { $table->string('pickup_by')->nullable()->after('tracking_number'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('orders', function (Blueprint $table) { // }); } }; 2023_04_05_103945_alter_order_table.php 0000644 00000001430 15021221741 0013021 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table) { $table->string('career_code')->nullable(); $table->string('service_code')->nullable(); $table->string('package_type_code')->nullable(); $table->decimal('shipping_charges')->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('orders', function (Blueprint $table) { // }); } }; 2024_07_23_013342_add_order_item_id_in_purchase_order_to_create_table.php 0000644 00000001317 15021221741 0021733 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('purchase_order_to_create', function (Blueprint $table) { $table->unsignedBigInteger('order_item_id')->after('order_id')->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('purchase_order_to_create', function (Blueprint $table) { $table->dropIfExists('order_item_id'); }); } }; 2022_12_15_084436_create_reviews_table.php 0000644 00000001334 15021221741 0013533 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('reviews', function (Blueprint $table) { $table->id(); $table->integer('user_id'); $table->integer('product_id'); $table->decimal('rating'); $table->text('comment'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('reviews'); } }; 2023_03_17_084636_alter_purchase_order_details_table.php 0000644 00000001220 15021221741 0016424 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('purchase_order_details', function (Blueprint $table) { $table->string('product_number')->after('price_id'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('purchase_order_details', function (Blueprint $table) { // }); } }; 2024_05_09_053205_add_column_amount_in_order_partial_payments_table.php 0000644 00000001224 15021221741 0021524 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('order_partial_payments', function (Blueprint $table) { $table->decimal('amount')->after('purchase_order_copy'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('order_partial_payments', function (Blueprint $table) { // }); } }; 2022_11_28_000011_create_orders_table.php 0000644 00000004331 15021221741 0013321 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateOrdersTable extends Migration { public function up() { Schema::create('orders', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('order_type')->default('Order'); $table->string('order_number')->nullable(); $table->boolean('admin_approved')->default(0); $table->string('payment_status'); $table->string('payment_type'); $table->string('purchase_order_number')->nullable()->comment('Payment type -> Purchase Order'); //Billing Address $table->string('billing_company_name')->nullable(); $table->string('billing_primary_contact_name')->nullable(); $table->string('billing_primary_contact_email')->nullable(); $table->string('billing_secondary_contact_name')->nullable(); $table->string('billing_secondary_contact_email')->nullable(); $table->string('billing_address_line_1')->nullable(); $table->string('billing_address_line_2')->nullable(); $table->string('billing_city')->nullable(); $table->string('billing_state')->nullable(); $table->string('billing_zipcode')->nullable(); $table->string('billing_phone_number')->nullable(); //Shipping Address $table->string('shipping_company_name')->nullable(); $table->string('shipping_primary_contact_name')->nullable(); $table->string('shipping_primary_contact_email')->nullable(); $table->string('shipping_secondary_contact_name')->nullable(); $table->string('shipping_secondary_contact_email')->nullable(); $table->string('shipping_address_line_1')->nullable(); $table->string('shipping_address_line_2')->nullable(); $table->string('shipping_city')->nullable(); $table->string('shipping_state')->nullable(); $table->string('shipping_zipcode')->nullable(); $table->string('shipping_phone_number')->nullable(); $table->timestamps(); }); } } 2022_12_28_080543_add_rush_order_column_to_orders_table.php 0000644 00000001172 15021221741 0017144 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table) { $table->string('rush_order')->after('order_type')->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('orders', function (Blueprint $table) { // }); } }; 2023_03_23_114532_alter_order_items_table.php 0000644 00000001301 15021221741 0014210 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('order_items', function (Blueprint $table) { $table->decimal('engraving_fee_total')->nullable(); $table->decimal('total_price_after_engraving')->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('order_items', function (Blueprint $table) { // }); } }; 2023_07_07_143225_alter_report_sales_tax_table.php 0000644 00000001672 15021221741 0015274 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { public function up() { DB::statement($this->dropView()); DB::statement($this->createView()); } private function createView(): string { return "CREATE VIEW report_sales_tax AS (SELECT o.order_number, o.payment_status, DATE_FORMAT(o.payment_date, '%Y-%m-%d') AS `date`, o.waive_off_sales_tax, o.waive_off_sales_tax_reason, o.resale_number, o.sales_tax_amount AS amount FROM orders o WHERE o.payment_status = 'Paid');"; } private function dropView(): string { return <<<SQL DROP VIEW IF EXISTS `report_sales_tax`; SQL; } }; 2022_12_06_120134_create_order_items_table.php 0000644 00000002257 15021221741 0014352 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('order_items', function (Blueprint $table) { $table->id(); $table->bigInteger('order_id'); $table->integer('product_id'); $table->string('product_name')->nullable(); $table->integer('attribute_id'); $table->string('attribute_name')->nullable(); $table->integer('attribute_option_id'); $table->string('attribute_option_name')->nullable(); $table->text('customization')->nullable(); $table->string('template')->nullable(); $table->integer('quantity'); $table->decimal('attribute_option_price', 10, 2); $table->decimal('price', 10, 2); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('order_items'); } }; 2023_03_14_072845_alter_orders_table.php 0000644 00000001156 15021221741 0013214 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table) { $table->dropForeign('current_status_fk_7675930'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('orders', function (Blueprint $table) { // }); } }; 2023_03_03_062629_alter_order_items_table.php 0000644 00000001052 15021221741 0014222 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('order_items', function (Blueprint $table) { $table->string('image')->after('template')->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { // } }; 2014_10_12_100000_create_password_resets_table.php 0000644 00000001253 15021221741 0015242 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreatePasswordResetsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('password_resets', function (Blueprint $table) { $table->string('email')->index(); $table->string('token'); $table->timestamp('created_at')->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('password_resets'); } } 2022_12_12_121929_create_contact_queries_table.php 0000644 00000001416 15021221741 0015234 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('contact_queries', function (Blueprint $table) { $table->id(); $table->string('name'); $table->string('email'); $table->string('phone')->nullable(); $table->string('subject'); $table->text('message'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('contact_us'); } }; 2022_11_28_000005_create_categories_table.php 0000644 00000001104 15021221741 0014146 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateCategoriesTable extends Migration { public function up() { Schema::create('categories', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('name'); $table->string('slug')->unique(); $table->tinyInteger('show_in_navigation')->default(0); $table->tinyInteger('status')->default(1); $table->timestamps(); }); } } 2023_01_13_142152_create_product_variation_combinations_table.php 0000644 00000002030 15021221741 0020325 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('product_variation_combinations', function (Blueprint $table) { $table->id(); $table->bigInteger('product_id')->unsigned(); $table->bigInteger('variation_id')->unsigned(); $table->bigInteger('product_price_id')->unsigned(); $table->timestamps(); $table->foreign('product_id')->references('id')->on('products'); $table->foreign('variation_id')->references('id')->on('variations'); $table->foreign('product_price_id')->references('id')->on('product_prices'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('product_variation_combinations'); } }; 2023_05_04_083743_create_order_item_customization_data_table.php 0000644 00000001323 15021221741 0020160 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('order_item_customization_data', function (Blueprint $table) { $table->id(); $table->bigInteger('order_item_id')->unsigned(); $table->string('customization'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('order_item_customization_data'); } }; 2023_06_09_152848_alter_order_artwork_reminders_table.php 0000644 00000002075 15021221741 0016664 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { public function up() { DB::statement($this->dropView()); DB::statement($this->createView()); } private function createView(): string { return "CREATE VIEW order_artwork_reminders AS SELECT o.id AS order_id, o.user_id, o.order_number, o.current_status_id, os.notes, o.created_at, o.updated_at FROM orders o LEFT JOIN users ON users.id = o.user_id LEFT JOIN order_status os ON os.status_id = o.current_status_id AND os.order_id = o.id WHERE o.current_status_id = 6"; } private function dropView(): string { return "DROP VIEW IF EXISTS `order_artwork_reminders`;"; } }; 2023_05_16_152930_create_payments_table.php 0000644 00000002017 15021221741 0013705 0 ustar 00 <?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('payments', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('order_id'); $table->string('transaction_id'); $table->string('terminal_id'); $table->string('action'); $table->string('amount_base'); $table->string('amount_total'); $table->string('method'); $table->string('status'); $table->string('approved'); $table->string('message'); $table->string('account_type'); $table->string('last_four'); $table->timestamps(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('payments'); } }; 2023_01_19_141241_alter_purchase_orders_table.php 0000644 00000001640 15021221741 0015072 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('purchase_orders', function (Blueprint $table) { $table->dropColumn('product_id'); $table->dropColumn('attribute_id'); $table->dropColumn('attribute_option_id'); $table->dropColumn('quantity'); $table->dropColumn('price'); $table->string('order_number')->after('vendor_id'); $table->integer( 'total_quantity')->after('order_number'); $table->decimal('total_price')->after('total_quantity'); }); } /** * Reverse the migrations. * * @return void */ public function down() { // } }; 2023_11_07_095557_add_invoice_id_column_to_orders_table.php 0000644 00000001212 15021221741 0017103 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table) { $table->string('pj_invoice_id')->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('orders', function (Blueprint $table) { $table->dropColumn('pj_invoice_id'); }); } }; 2022_11_28_000002_create_permissions_table.php 0000644 00000000653 15021221741 0014401 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreatePermissionsTable extends Migration { public function up() { Schema::create('permissions', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('title')->nullable(); $table->timestamps(); }); } } 2023_03_20_130520_alter_orders_table.php 0000644 00000001047 15021221741 0013171 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table) { $table->bigInteger('invoice_id')->unsigned()->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { // } }; 2023_12_07_130232_alter_coupons__table.php 0000644 00000001222 15021221741 0013520 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('coupons', function (Blueprint $table) { $table->integer('redemption_count')->after('number_of_usage')->default(0)->change(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('coupons', function (Blueprint $table) { // }); } }; 2023_05_30_072129_create_purchase_order_order_details.php 0000644 00000001411 15021221741 0016575 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('purchase_order_order_details', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('purchase_order_details_id'); $table->unsignedBigInteger('order_id'); $table->integer('quantity'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('purchase_order_order_details'); } }; 2022_11_28_000001_create_media_table.php 0000644 00000002034 15021221741 0013077 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateMediaTable extends Migration { public function up() { 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(); }); } } 2024_01_23_113238_add_secondary_email_column_to_vendors_table.php 0000644 00000001174 15021221741 0020303 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('vendors', function (Blueprint $table) { $table->string('secondary_email')->nullable()->after('email'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('vendors', function (Blueprint $table) { // }); } }; 2022_11_28_000010_create_address_books_table.php 0000644 00000002036 15021221741 0014644 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateAddressBooksTable extends Migration { public function up() { Schema::create('address_books', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('company_name')->nullable(); $table->string('primary_contact_name'); $table->string('primary_contact_email'); $table->string('secondary_contact_name')->nullable(); $table->string('secondary_contact_email')->nullable(); $table->string('address_line_1')->nullable(); $table->string('address_line_2')->nullable(); $table->string('city')->nullable(); $table->integer('state_id')->nullable(); $table->string('zipcode')->nullable(); $table->string('phone_number'); $table->boolean('is_default')->default(0)->nullable(); $table->timestamps(); }); } } 2023_04_11_124352_create_report_sales_view_table.php 0000644 00000003504 15021221741 0015572 0 ustar 00 <?php 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 { public function up() { DB::statement($this->dropView()); DB::statement($this->createView()); } private function createView(): string { return "CREATE VIEW report_sales AS (SELECT o.order_number, o.updated_at AS date, o.payment_status, o.grand_total, SUM(COALESCE(o.rush_order_amount, 0) + COALESCE(o.sales_tax_amount, 0) + COALESCE(o.shipping_charges, 0) + (SELECT SUM(total_price_after_engraving) FROM order_items WHERE order_items.order_id = o.id)) AS amount FROM orders o WHERE o.current_status_id = 13 GROUP BY o.order_number, o.updated_at, o.payment_status, o.grand_total);"; /*return "CREATE VIEW report_sales AS (SELECT o.order_number, o.updated_at AS date, o.current_status_id, SUM(COALESCE(o.rush_order_amount, 0) + COALESCE(o.sales_tax_amount, 0) + COALESCE(o.shipping_charges, 0) + (SELECT SUM(total_price_after_engraving) FROM order_items WHERE order_items.order_id = o.id)) AS amount FROM orders o WHERE o.current_status_id = 13 GROUP BY o.order_number, o.updated_at, o.current_status_id );";*/ /*return "CREATE VIEW report_sales AS (SELECT o.order_number, o.updated_at AS date, o.current_status_id, SUM(o.grand_total) AS amount FROM orders o WHERE o.current_status_id = 13 GROUP BY o.order_number, o.updated_at, o.current_status_id);";*/ } private function dropView(): string { return <<<SQL DROP VIEW IF EXISTS `report_sales`; SQL; } }; 2023_01_18_104331_create_order_item_variations_table.php 0000644 00000001410 15021221741 0016417 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('order_item_variations', function (Blueprint $table) { $table->id(); $table->integer('order_id'); $table->integer('product_id'); $table->integer('order_item_id'); $table->integer('variation_id'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('order_item_variations'); } }; 2023_01_19_141854_alter_purchase_order_details_table.php 0000644 00000001314 15021221741 0016424 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('purchase_order_details', function (Blueprint $table) { $table->bigInteger('price_id')->after('product_id'); $table->decimal('total_price')->after('price'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('purchase_order_details', function (Blueprint $table) { // }); } }; 2023_07_06_074625_add_wave_off_reason_column_to_orders_table.php 0000644 00000001361 15021221741 0020140 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table) { $table->string('waive_off_sales_tax_reason')->after('waive_off_sales_tax')->nullable(); $table->string('resale_number')->after('waive_off_sales_tax_reason')->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('orders', function (Blueprint $table) { // }); } }; 2023_05_26_080445_remove_unused_tables.php 0000644 00000001236 15021221741 0013571 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::dropIfExists('attribute_options'); Schema::dropIfExists('attributes'); Schema::dropIfExists('order_item_attributes'); Schema::dropIfExists('product_attribute_options'); Schema::dropIfExists('purchase_order_items'); } /** * Reverse the migrations. * * @return void */ public function down() { // } }; 2023_03_21_073821_alter_product_prices_table.php 0000644 00000001422 15021221741 0014730 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('product_prices', function (Blueprint $table) { $table->decimal('length')->nullable()->after('shipping_weight'); $table->decimal('width')->nullable()->after('length'); $table->decimal('height')->nullable()->after('width'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('product_prices', function (Blueprint $table) { // }); } }; 2022_11_28_000007_create_product_prices_table.php 0000644 00000000772 15021221741 0015062 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateProductPricesTable extends Migration { public function up() { Schema::create('product_prices', function (Blueprint $table) { $table->bigIncrements('id'); $table->integer('qty_from'); $table->integer('qty_to'); $table->float('price', 15, 2); $table->timestamps(); }); } } 2023_03_13_101339_alter_orders_table.php 0000644 00000001315 15021221741 0013177 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table) { $table->string('purchase_order_copy')->after('purchase_order_number')->nullable(); $table->decimal('amount_paid', 10, 4)->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('orders', function (Blueprint $table) { // }); } }; 2023_07_06_090010_add_items_total_column_to_orders_table.php 0000644 00000001206 15021221741 0017301 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table) { $table->decimal('items_total')->after('cancellation_charges')->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('orders', function (Blueprint $table) { // }); } }; 2022_11_28_000008_create_attributes_table.php 0000644 00000000735 15021221741 0014223 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateAttributesTable extends Migration { public function up() { Schema::create('attributes', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('name')->unique(); $table->tinyInteger('status')->default(1); $table->timestamps(); }); } } 2022_11_28_000016_add_relationship_fields_to_products_table.php 0000644 00000000743 15021221741 0017774 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class AddRelationshipFieldsToProductsTable extends Migration { public function up() { Schema::table('products', function (Blueprint $table) { $table->unsignedBigInteger('category_id')->nullable(); $table->foreign('category_id', 'category_fk_7675564')->references('id')->on('categories'); }); } } 2023_10_11_092533_add_sms_notification_field_in_users_table.php 0000644 00000001177 15021221741 0017753 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('users', function (Blueprint $table) { $table->tinyInteger('sms_notification')->after('status')->default(0); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('users', function (Blueprint $table) { // }); } }; 2024_01_16_135942_alter_product_prices_table.php 0000644 00000001215 15021221741 0014736 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('product_prices', function (Blueprint $table) { $table->double('vendor_price')->nullable()->default(0)->change(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('product_prices', function (Blueprint $table) { // }); } }; 2023_01_13_134803_alter_products_table.php 0000644 00000001434 15021221741 0013546 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('products', function (Blueprint $table) { $table->dropColumn('supplier_prod_number'); $table->dropColumn('shipping_weight'); $table->dropColumn('vendor_price'); $table->float('avg_price', 15, 2)->nullable()->after('price_to'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('products', function (Blueprint $table) { // }); } }; 2022_11_29_125112_create_product_attribute_options_table.php 0000644 00000001453 15021221741 0017356 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('product_attribute_options', function (Blueprint $table) { $table->id(); $table->integer('product_id'); $table->integer('attribute_id'); $table->integer('attribute_option_id'); $table->decimal('attribute_option_price', 10, 2); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('product_attribute_options'); } }; 2022_12_29_132514_alter_orders_table.php 0000644 00000001203 15021221741 0013200 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table){ $table->date('delivery_date')->nullable()->after('purchase_order_number'); $table->date('event_date')->nullable()->after('delivery_date'); }); } /** * Reverse the migrations. * * @return void */ public function down() { // } }; 2023_02_22_142832_add_product_sketch_column_to_product_prices_table.php 0000644 00000001171 15021221741 0021531 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('product_prices', function (Blueprint $table) { $table->string('product_sketch')->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('product_prices', function (Blueprint $table) { // }); } }; 2023_03_08_080604_alter_reviews_table.php 0000644 00000001554 15021221741 0013377 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('reviews', function (Blueprint $table) { $table->dropColumn('order_id'); $table->dropColumn('comment'); }); Schema::table('reviews', function (Blueprint $table) { $table->bigInteger('order_id')->unsigned()->nullable()->after('user_id'); $table->text('comment')->nullable()->after('rating'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('reviews', function (Blueprint $table) { // }); } }; 2023_12_01_134508_add_product_type_column_to_purchase_order_details_table.php 0000644 00000001326 15021221741 0022717 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('purchase_order_details', function (Blueprint $table) { $table->enum('product_type', ['standard', 'configurable']) ->default('standard')->after('product_number'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('purchase_order_details', function (Blueprint $table) { // }); } }; 2022_11_28_000017_add_relationship_fields_to_product_prices_table.php 0000644 00000000751 15021221741 0021156 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class AddRelationshipFieldsToProductPricesTable extends Migration { public function up() { Schema::table('product_prices', function (Blueprint $table) { $table->unsignedBigInteger('product_id')->nullable(); $table->foreign('product_id', 'product_fk_7675557')->references('id')->on('products'); }); } } 2023_12_08_094011_alter_purchase_order_details_table.php 0000644 00000001677 15021221741 0016430 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('purchase_order_details', function (Blueprint $table) { $table->dropColumn('product_type'); $table->unsignedBigInteger('price_id')->nullable()->change(); }); Schema::table('purchase_order_details', function (Blueprint $table) { $table->enum('product_type', ['standard', 'configurable', 'office_supplies']) ->default('standard')->after('product_number'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('purchase_order_details', function (Blueprint $table) { // }); } }; 2023_07_11_124352_create_report_payment_collection_view_table.php 0000644 00000002621 15021221741 0020355 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { public function up() { DB::statement($this->dropView()); DB::statement($this->createView()); } private function createView(): string { return "CREATE VIEW report_payment_collection AS ( SELECT o.order_number, o.payment_status, o.payment_date AS `date`, o.waive_off_sales_tax, o.payment_type, o.cheque_number, o.purchase_order_number, payments.`last_four`, CASE WHEN o.waive_off_sales_tax = 0 THEN COALESCE (o.items_total, 0) + COALESCE (o.rush_order_fee, 0) + COALESCE (o.sales_tax_amount, 0) + COALESCE (o.shipping_charges, 0) ELSE COALESCE (o.items_total, 0) + COALESCE (o.rush_order_fee, 0) + COALESCE (o.shipping_charges, 0) END AS amount FROM orders o LEFT JOIN payments ON o.`payment_id` = payments.`id` WHERE o.payment_status = 'Paid');"; } private function dropView(): string { return <<<SQL DROP VIEW IF EXISTS `report_payment_collection`; SQL; } }; 2023_03_15_092019_alter_order_items_table.php 0000644 00000001307 15021221741 0014224 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('order_items', function (Blueprint $table) { $table->decimal('engraving_fee')->nullable()->default(0); $table->boolean('approve_consent')->nullable()->default(0); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('order_items', function (Blueprint $table) { // }); } }; 2023_01_03_091728_create_order_item_attributes_table.php 0000644 00000001632 15021221741 0016445 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('order_item_attributes', function (Blueprint $table) { $table->id(); $table->integer('order_item_id'); $table->integer('attribute_id'); $table->string('attribute_name')->nullable(); $table->integer('attribute_option_id'); $table->string('attribute_option_name')->nullable(); $table->integer('attribute_option_price'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('order_item_attributes'); } }; 2022_12_14_151220_create_wishlists_table.php 0000644 00000001224 15021221741 0014057 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('wishlists', function (Blueprint $table) { $table->id(); $table->integer('user_id'); $table->integer('product_id'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('wishlists'); } }; 2024_05_28_034820_add_column_admin_notes_in_purchase_orders_table.php 0000644 00000001222 15021221741 0021143 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('purchase_orders', function (Blueprint $table) { $table->longText('admin_notes')->after('special_notes')->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('purchase_orders', function (Blueprint $table) { // }); } }; 2023_03_09_081002_alter_statuses_table.php 0000644 00000001043 15021221741 0013551 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('statuses', function (Blueprint $table) { $table->string('color')->after('name')->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { // } }; 2024_01_19_120213_create_order_item_customization_svgs_table.php 0000644 00000001535 15021221741 0020221 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('order_item_customization_svgs', function (Blueprint $table) { $table->id(); $table->unsignedBigInteger('order_id'); $table->unsignedBigInteger('order_item_id'); $table->integer('customization_index'); $table->text('file_content'); $table->string('file_name'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('order_item_customization_svgs'); } }; 2024_05_08_234146_alter_orders_table.php 0000644 00000001543 15021221741 0013214 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table) { $table->enum('payment_mode', ['Full', 'Partial'])->after('admin_approved')->default('Full'); $table->decimal('paid_order_amount')->nullable()->after('amount_paid')->default(0); $table->decimal('remaining_order_amount')->nullable()->after('paid_order_amount')->default(0); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('orders', function (Blueprint $table) { // }); } }; 2023_01_18_092902_alter_order_items_table.php 0000644 00000001451 15021221741 0014226 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('order_items', function (Blueprint $table) { $table->bigInteger('price_id')->unsigned(); $table->decimal('total_price')->after('quantity'); $table->integer('qty_from')->after('total_price'); $table->integer('qty_to')->after('qty_from'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('order_items', function (Blueprint $table) { // }); } }; 2023_11_30_121612_alter_products_table.php 0000644 00000001361 15021221741 0013537 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('products', function (Blueprint $table) { $table->enum('product_type', ['standard', 'configurable'])->default('standard')->after('slug'); $table->boolean('is_draft')->default(false)->after('product_sketch'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('products', function (Blueprint $table) { // }); } }; 2023_11_30_124831_alter_variations_table.php 0000644 00000001325 15021221741 0014061 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('variations', function (Blueprint $table) { $table->unsignedBigInteger('vendor_id')->nullable()->after('value'); $table->decimal('vendor_price')->nullable()->after('vendor_id'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('variations', function (Blueprint $table) { // }); } }; 2023_03_20_081622_create_order_invoices_table.php 0000644 00000001450 15021221741 0015047 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('order_invoices', function (Blueprint $table) { $table->id(); $table->bigInteger('order_id')->unsigned(); $table->string('invoice_number'); $table->string('pdf'); $table->string('invoice_status')->nullable()->comment('Paid / Unpaid'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('order_invoices'); } }; 2023_02_13_115628_add_email_token_column_to_users_table.php 0000644 00000001204 15021221741 0017113 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('users', function (Blueprint $table) { $table->string('email_token')->nullable()->after('password_last_changed'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('users', function (Blueprint $table) { // }); } }; 2023_01_16_151717_add_created_by_user_id_column_to_orders_table.php 0000644 00000001176 15021221741 0020605 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('orders', function (Blueprint $table) { $table->bigInteger('created_by_user_id')->after('id')->unsigned(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('orders', function (Blueprint $table) { // }); } }; 2023_06_02_142343_create_order_payment_reminders_table.php 0000644 00000002330 15021221741 0016754 0 ustar 00 <?php 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 { public function up() { DB::statement($this->dropView()); DB::statement($this->createView()); } private function createView(): string { return "CREATE VIEW order_payment_reminders AS ( SELECT o.id AS order_id, o.user_id, o.order_number, o.payment_status, o.grand_total, o.current_status_id, users.reminder_duration, o.created_at FROM orders o LEFT JOIN users ON users.id = o.user_id WHERE o.payment_status = 'Unpaid' AND o.current_status_id = 13 AND o.created_at <= DATE_SUB(NOW(), INTERVAL users.reminder_duration DAY) );"; } private function dropView(): string { return "DROP VIEW IF EXISTS `order_payment_reminders`;"; } }; 2023_07_07_063130_alter_users_table.php 0000644 00000001432 15021221741 0013045 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('users', function (Blueprint $table) { $table->date('birth_date')->after('user_type')->nullable(); $table->string('secondary_email')->after('birth_date')->nullable(); $table->string('secondary_phone')->after('secondary_email')->nullable(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('users', function (Blueprint $table) { // }); } }; 2023_05_18_152446_add_jp_customer_id_to_users_table.php 0000644 00000001304 15021221741 0016265 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('users', function (Blueprint $table) { $table->bigInteger('pj_customer_id')->nullable()->after('id') ->comment('This id is associated with Pay Junction portal'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('users', function (Blueprint $table) { // }); } }; 2023_03_15_123301_alter_vendors_table.php 0000644 00000001546 15021221741 0013362 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; return new class extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::table('vendors', function (Blueprint $table) { $table->text('address')->nullable()->after('phone'); $table->string('account_number')->nullable()->after('address'); $table->string('payment_terms')->nullable()->after('account_number'); $table->string('credit_card_ending')->nullable()->after('payment_terms'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::table('vendors', function (Blueprint $table) { // }); } }; 2024_08_23_172828_add_relationship_field_to_company_user_table.php 0000644 00000001240 15021236432 0020476 0 ustar 00 <?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('company_user', function (Blueprint $table) { $table->foreign('branch_id', 'branch_id_fk_10024453')->references('id')->on('branches')->onUpdate('CASCADE')->onDelete('CASCADE'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('company_user', function (Blueprint $table) { // }); } }; 2024_08_20_000027_add_relationship_fields_to_suppliers_table.php 0000644 00000001234 15021236432 0020160 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class AddRelationshipFieldsToSuppliersTable extends Migration { public function up() { Schema::table('suppliers', function (Blueprint $table) { $table->unsignedBigInteger('organization_id')->nullable(); $table->foreign('organization_id', 'organization_fk_10024033')->references('id')->on('organizations'); $table->unsignedBigInteger('country_id')->nullable(); $table->foreign('country_id', 'country_fk_10024042')->references('id')->on('countries'); }); } } 2024_08_20_000010_create_companies_table.php 0000644 00000000734 15021236432 0014006 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateCompaniesTable extends Migration { public function up() { Schema::create('companies', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('name', 30); $table->string('contact_number', 20)->nullable(); $table->timestamps(); }); } } 2024_08_20_150512_create_jobs_table.php 0000644 00000001456 15021236432 0013004 0 ustar 00 <?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('jobs', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('queue')->index(); $table->longText('payload'); $table->unsignedTinyInteger('attempts'); $table->unsignedInteger('reserved_at')->nullable(); $table->unsignedInteger('available_at'); $table->unsignedInteger('created_at'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('jobs'); } }; 2024_08_20_000016_create_asset_tags_table.php 0000644 00000000765 15021236432 0014177 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateAssetTagsTable extends Migration { public function up() { Schema::create('asset_tags', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('tag_name', 50); $table->string('code', 20); $table->string('serial', 30); $table->timestamps(); }); } } 2024_08_23_172633_add_branch_id_field_in_company_user_table.php 0000644 00000001106 15021236432 0017665 0 ustar 00 <?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('company_user', function (Blueprint $table) { $table->unsignedBigInteger('branch_id'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('company_user', function (Blueprint $table) { // }); } }; 2024_08_20_000018_create_company_user_pivot_table.php 0000644 00000001216 15021236432 0015761 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateCompanyUserPivotTable extends Migration { public function up() { Schema::create('company_user', function (Blueprint $table) { $table->unsignedBigInteger('user_id'); $table->foreign('user_id', 'user_id_fk_10023979')->references('id')->on('users')->onDelete('cascade'); $table->unsignedBigInteger('company_id'); $table->foreign('company_id', 'company_id_fk_10023979')->references('id')->on('companies')->onDelete('cascade'); }); } } 2024_08_20_000019_create_role_user_pivot_table.php 0000644 00000001173 15021236432 0015257 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateRoleUserPivotTable extends Migration { public function up() { Schema::create('role_user', function (Blueprint $table) { $table->unsignedBigInteger('user_id'); $table->foreign('user_id', 'user_id_fk_10016428')->references('id')->on('users')->onDelete('cascade'); $table->unsignedBigInteger('role_id'); $table->foreign('role_id', 'role_id_fk_10016428')->references('id')->on('roles')->onDelete('cascade'); }); } } 2024_08_20_000026_add_relationship_fields_to_departments_table.php 0000644 00000001503 15021236432 0020456 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class AddRelationshipFieldsToDepartmentsTable extends Migration { public function up() { Schema::table('departments', function (Blueprint $table) { $table->unsignedBigInteger('organization_id')->nullable(); $table->foreign('organization_id', 'organization_fk_10023981')->references('id')->on('organizations'); $table->unsignedBigInteger('company_id')->nullable(); $table->foreign('company_id', 'company_fk_10023982')->references('id')->on('companies'); $table->unsignedBigInteger('manager_id')->nullable(); $table->foreign('manager_id', 'manager_fk_10023985')->references('id')->on('users'); }); } } 2024_08_20_000030_add_relationship_fields_to_asset_tags_table.php 0000644 00000001224 15021236432 0020260 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class AddRelationshipFieldsToAssetTagsTable extends Migration { public function up() { Schema::table('asset_tags', function (Blueprint $table) { $table->unsignedBigInteger('organization_id')->nullable(); $table->foreign('organization_id', 'organization_fk_10024071')->references('id')->on('organizations'); $table->unsignedBigInteger('asset_id')->nullable(); $table->foreign('asset_id', 'asset_fk_10024072')->references('id')->on('assets'); }); } } 2024_08_20_000002_create_permissions_table.php 0000644 00000000653 15021236432 0014404 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreatePermissionsTable extends Migration { public function up() { Schema::create('permissions', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('title')->nullable(); $table->timestamps(); }); } } 2024_08_20_000001_create_media_table.php 0000644 00000002034 15021236432 0013102 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateMediaTable extends Migration { public function up() { 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(); }); } } 2024_09_06_094852_add_organization_id_column_in_maintenance_schedules_table.php 0000644 00000001210 15021236432 0023167 0 ustar 00 <?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('maintenance_schedules', function (Blueprint $table) { $table->foreignId('organization_id')->constrained('organizations')->onUpdate('cascade'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('maintenance_schedules', function (Blueprint $table) { // }); } }; 2024_08_20_000025_add_relationship_fields_to_branches_table.php 0000644 00000001232 15021236432 0017713 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class AddRelationshipFieldsToBranchesTable extends Migration { public function up() { Schema::table('branches', function (Blueprint $table) { $table->unsignedBigInteger('organization_id')->nullable(); $table->foreign('organization_id', 'organization_fk_10023970')->references('id')->on('organizations'); $table->unsignedBigInteger('company_id')->nullable(); $table->foreign('company_id', 'company_fk_10023971')->references('id')->on('companies'); }); } } 2024_08_20_000011_create_branches_table.php 0000644 00000001076 15021236432 0013616 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateBranchesTable extends Migration { public function up() { Schema::create('branches', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('name', 30); $table->string('email')->nullable(); $table->string('contact_number', 20)->nullable(); $table->string('address')->nullable(); $table->timestamps(); }); } } 2024_08_20_151026_create_failed_jobs_table.php 0000644 00000001400 15021236432 0014276 0 ustar 00 <?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('failed_jobs', function (Blueprint $table) { $table->id(); $table->string('uuid')->unique(); $table->text('connection'); $table->text('queue'); $table->longText('payload'); $table->longText('exception'); $table->timestamp('failed_at')->useCurrent(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('failed_jobs'); } }; 2024_08_20_000008_create_statuses_table.php 0000644 00000000634 15021236432 0013711 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateStatusesTable extends Migration { public function up() { Schema::create('statuses', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('name', 30); $table->timestamps(); }); } } 2024_08_20_000014_create_manufacturers_table.php 0000644 00000001332 15021236432 0014706 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateManufacturersTable extends Migration { public function up() { Schema::create('manufacturers', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('name', 30); $table->string('support_url')->nullable(); $table->string('support_contact_number', 20)->nullable(); $table->string('support_email')->nullable(); $table->string('warranty_lookup_url')->nullable(); $table->unsignedTinyInteger('status')->default(1); $table->timestamps(); }); } } 2024_08_20_000024_add_relationship_fields_to_companies_table.php 0000644 00000000765 15021236432 0020115 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class AddRelationshipFieldsToCompaniesTable extends Migration { public function up() { Schema::table('companies', function (Blueprint $table) { $table->unsignedBigInteger('organization_id')->nullable(); $table->foreign('organization_id', 'organization_fk_10023962')->references('id')->on('organizations'); }); } } 2024_08_21_100322_add_password_reset_code_column_in_users_table.php 0000644 00000001102 15021236432 0020635 0 ustar 00 <?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('password_reset_code')->nullable(); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('users', function (Blueprint $table) { // }); } }; 2024_09_06_081802_create_maintenance_schedules_table.php 0000644 00000003412 15021236432 0016374 0 ustar 00 <?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('maintenance_schedules', function (Blueprint $table) { $table->bigIncrements('id'); $table->unsignedBigInteger('asset_id'); $table->enum('maintenance_type', ['1', '2', '3'])->comment('1: Routine, 2: Corrective:, 3: Preventive')->default('1'); $table->date('scheduled_date'); $table->date('completion_date')->nullable(); $table->enum('status', ['1', '2', '3'])->default('1')->comment('1: Pending, 2: In Progress, 3: Completed'); $table->enum('frequency', ['1', '2', '3', '4', '5', '6'])->default('1')->comment('1: One-time, 2: Daily, 3: Weekly, 4, Quarterly, 5: Monthly, 6: Annually'); $table->integer('interval')->nullable(); $table->decimal('cost', 10, 2)->nullable(); $table->unsignedBigInteger('assigned_to')->nullable(); $table->date('next_scheduled_date')->nullable(); $table->text('notes')->nullable(); $table->timestamps(); // Foreign Key Constraints $table->foreign('asset_id')->references('id')->on('assets')->onDelete('cascade')->onUpdate('cascade'); // Assuming you have a `users` or `employees` table for the `assigned_to` foreign key $table->foreign('assigned_to')->references('id')->on('users')->onDelete('set null')->onUpdate('cascade'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::dropIfExists('maintenance_schedules'); } }; .DS_Store 0000644 00000014004 15021236432 0006224 0 ustar 00 Bud1 % @ � @ � @ � @ E % DSDB ` � @ � @ � @ 2024_08_20_000022_add_relationship_fields_to_statuses_table.php 0000644 00000000763 15021236432 0020006 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class AddRelationshipFieldsToStatusesTable extends Migration { public function up() { Schema::table('statuses', function (Blueprint $table) { $table->unsignedBigInteger('organization_id')->nullable(); $table->foreign('organization_id', 'organization_fk_10023951')->references('id')->on('organizations'); }); } } 2024_08_20_000029_add_relationship_fields_to_categories_table.php 0000644 00000000767 15021236432 0020273 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class AddRelationshipFieldsToCategoriesTable extends Migration { public function up() { Schema::table('categories', function (Blueprint $table) { $table->unsignedBigInteger('organization_id')->nullable(); $table->foreign('organization_id', 'organization_fk_10024068')->references('id')->on('organizations'); }); } } 2024_08_20_000003_create_roles_table.php 0000644 00000000637 15021236432 0013160 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateRolesTable extends Migration { public function up() { Schema::create('roles', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('title')->nullable(); $table->timestamps(); }); } } 2024_08_20_000012_create_departments_table.php 0000644 00000000740 15021236432 0014355 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateDepartmentsTable extends Migration { public function up() { Schema::create('departments', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('name', 30); $table->string('contact_number', 20)->nullable(); $table->timestamps(); }); } } 2024_08_20_000004_create_users_table.php 0000644 00000001506 15021236432 0013172 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateUsersTable extends Migration { public function up() { Schema::create('users', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('first_name', 30)->nullable(); $table->string('last_name', 30)->nullable(); $table->string('email')->nullable()->unique(); $table->string('password')->nullable(); $table->string('contact_number', 20)->nullable(); $table->unsignedTinyInteger('status')->default(1); $table->datetime('email_verified_at')->nullable(); $table->string('remember_token')->nullable(); $table->timestamps(); }); } } 2024_08_20_000009_create_assets_table.php 0000644 00000001437 15021236432 0013343 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateAssetsTable extends Migration { public function up() { Schema::create('assets', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('asset_name'); $table->integer('qty')->nullable(); $table->longText('notes')->nullable(); $table->date('asset_expiration_date')->nullable(); $table->date('next_audit_date')->nullable(); $table->date('purchase_date')->nullable(); $table->date('eol_date')->nullable(); $table->decimal('purchase_cost', 15, 2)->nullable(); $table->timestamps(); }); } } 2024_08_20_000015_create_categories_table.php 0000644 00000000725 15021236432 0014162 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateCategoriesTable extends Migration { public function up() { Schema::create('categories', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('name', 30); $table->text('description')->nullable(); $table->timestamps(); }); } } 2024_08_20_000021_add_relationship_fields_to_users_table.php 0000644 00000000755 15021236432 0017274 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class AddRelationshipFieldsToUsersTable extends Migration { public function up() { Schema::table('users', function (Blueprint $table) { $table->unsignedBigInteger('organization_id')->nullable(); $table->foreign('organization_id', 'organization_fk_10023934')->references('id')->on('organizations'); }); } } 2024_08_20_124720_add_user_type_field_in_users_table.php 0000644 00000001105 15021236432 0016416 0 ustar 00 <?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->unsignedTinyInteger('user_type')->default(0); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('users', function (Blueprint $table) { // }); } }; 2024_08_20_000017_create_permission_role_pivot_table.php 0000644 00000001237 15021236432 0016470 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreatePermissionRolePivotTable extends Migration { public function up() { Schema::create('permission_role', function (Blueprint $table) { $table->unsignedBigInteger('role_id'); $table->foreign('role_id', 'role_id_fk_10016419')->references('id')->on('roles')->onDelete('cascade'); $table->unsignedBigInteger('permission_id'); $table->foreign('permission_id', 'permission_id_fk_10016419')->references('id')->on('permissions')->onDelete('cascade'); }); } } 2024_08_20_000023_add_relationship_fields_to_assets_table.php 0000644 00000003250 15021236432 0017430 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class AddRelationshipFieldsToAssetsTable extends Migration { public function up() { Schema::table('assets', function (Blueprint $table) { $table->unsignedBigInteger('organization_id')->nullable(); $table->foreign('organization_id', 'organization_fk_10023957')->references('id')->on('organizations'); $table->unsignedBigInteger('asset_status_id')->nullable(); $table->foreign('asset_status_id', 'asset_status_fk_10024452')->references('id')->on('statuses'); $table->unsignedBigInteger('category_id')->nullable(); $table->foreign('category_id', 'category_fk_10024453')->references('id')->on('categories'); $table->unsignedBigInteger('manufacturer_id')->nullable(); $table->foreign('manufacturer_id', 'manufacturer_fk_10024454')->references('id')->on('manufacturers'); $table->unsignedBigInteger('supplier_id')->nullable(); $table->foreign('supplier_id', 'supplier_fk_10024455')->references('id')->on('suppliers'); $table->unsignedBigInteger('company_id')->nullable(); $table->foreign('company_id', 'company_fk_10024456')->references('id')->on('companies'); $table->unsignedBigInteger('branch_id')->nullable(); $table->foreign('branch_id', 'branch_fk_10024457')->references('id')->on('branches'); $table->unsignedBigInteger('currency_id')->nullable(); $table->foreign('currency_id', 'currency_fk_10024466')->references('id')->on('currencies'); }); } } 2024_08_20_000013_create_suppliers_table.php 0000644 00000001634 15021236432 0014061 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateSuppliersTable extends Migration { public function up() { Schema::create('suppliers', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('contact_name', 30); $table->string('contact_email')->nullable(); $table->string('contact_number', 20)->nullable(); $table->string('address_line_1')->nullable(); $table->string('address_line_2')->nullable(); $table->string('city', 30)->nullable(); $table->string('state')->nullable(); $table->string('zip_code', 10)->nullable(); $table->string('url')->nullable(); $table->unsignedTinyInteger('status')->default(1); $table->timestamps(); }); } } 2024_08_20_000028_add_relationship_fields_to_manufacturers_table.php 0000644 00000000775 15021236432 0021023 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class AddRelationshipFieldsToManufacturersTable extends Migration { public function up() { Schema::table('manufacturers', function (Blueprint $table) { $table->unsignedBigInteger('organization_id')->nullable(); $table->foreign('organization_id', 'organization_fk_10024050')->references('id')->on('organizations'); }); } } 2024_08_20_000005_create_organizations_table.php 0000644 00000001363 15021236432 0014722 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateOrganizationsTable extends Migration { public function up() { Schema::create('organizations', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('name', 50); $table->string('email')->unique(); $table->string('contact_number', 20)->nullable(); $table->string('address_line_1')->nullable(); $table->string('address_line_2')->nullable(); $table->unsignedTinyInteger('status')->default(1); $table->date('date_expiration'); $table->timestamps(); }); } } 2024_08_29_133545_add_organization_id_column_in_currencies_table.php 0000644 00000001162 15021236432 0021013 0 ustar 00 <?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('currencies', function (Blueprint $table) { $table->foreignId('organization_id')->constrained('organizations')->onUpdate('cascade'); }); } /** * Reverse the migrations. */ public function down(): void { Schema::table('currencies', function (Blueprint $table) { // }); } }; 2024_08_20_000020_add_relationship_fields_to_roles_table.php 0000644 00000000755 15021236432 0017256 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class AddRelationshipFieldsToRolesTable extends Migration { public function up() { Schema::table('roles', function (Blueprint $table) { $table->unsignedBigInteger('organization_id')->nullable(); $table->foreign('organization_id', 'organization_fk_10023933')->references('id')->on('organizations'); }); } } 2024_08_20_000006_create_countries_table.php 0000644 00000000743 15021236432 0014050 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateCountriesTable extends Migration { public function up() { Schema::create('countries', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('name', 50)->nullable(); $table->string('short_code', 3)->nullable(); $table->timestamps(); }); } } 2024_08_20_000007_create_currencies_table.php 0000644 00000001016 15021236432 0014172 0 ustar 00 <?php use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class CreateCurrenciesTable extends Migration { public function up() { Schema::create('currencies', function (Blueprint $table) { $table->bigIncrements('id'); $table->string('name', 30)->unique(); $table->string('code', 3)->unique(); $table->string('symbol', 3)->unique(); $table->timestamps(); }); } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка