chengwl 1 месяц назад
Родитель
Сommit
7b870f3a24

+ 26 - 0
database/migrations/2026_08_20_163200_add_asteria_migration_columns_to_customers_table.php

@@ -0,0 +1,26 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+    public function up(): void
+    {
+        Schema::table('customers', function (Blueprint $table) {
+            $table->unsignedBigInteger('migrated_from_asteria_id')->nullable()->after('id');
+            $table->text('legacy_password')->nullable()->after('password');
+
+            $table->unique('migrated_from_asteria_id', 'uq_customers_migrated_asteria_id');
+        });
+    }
+
+    public function down(): void
+    {
+        Schema::table('customers', function (Blueprint $table) {
+            $table->dropUnique('uq_customers_migrated_asteria_id');
+            $table->dropColumn(['migrated_from_asteria_id', 'legacy_password']);
+        });
+    }
+};