id(); $table->foreignId('store_id')->unique()->constrained()->cascadeOnDelete(); $table->string('account_name')->nullable(); // Kept encrypted. They let us act on the merchant's EasyParcel account. $table->text('access_token'); $table->text('refresh_token')->nullable(); $table->timestamp('expires_at')->nullable(); $table->timestamps(); }); Schema::table('stores', function (Blueprint $table) { // Where couriers collect parcels from: name, phone, line1, line2, city, postcode, state. $table->json('pickup_address')->nullable()->after('free_shipping_over'); // The usual parcel, used to fill in the booking form: weight in grams, size in cm. $table->unsignedInteger('parcel_weight')->default(1000)->after('pickup_address'); $table->json('parcel_size')->nullable()->after('parcel_weight'); }); Schema::table('orders', function (Blueprint $table) { $table->string('shipment_number')->nullable()->after('tracking_number'); $table->string('shipment_order_number')->nullable()->after('shipment_number'); $table->unsignedInteger('shipment_cost')->nullable()->after('shipment_order_number'); $table->text('label_url')->nullable()->after('shipment_cost'); $table->text('tracking_url')->nullable()->after('label_url'); }); } public function down(): void { Schema::table('orders', function (Blueprint $table) { $table->dropColumn(['shipment_number', 'shipment_order_number', 'shipment_cost', 'label_url', 'tracking_url']); }); Schema::table('stores', function (Blueprint $table) { $table->dropColumn(['pickup_address', 'parcel_weight', 'parcel_size']); }); Schema::dropIfExists('easyparcel_accounts'); } };