9bd6fd898d
Pliega las migraciones de "añadir/modificar columna" dentro de la migración create de cada tabla, con esquema final idéntico (verificado por diff normalizado de columnas + índices y suite completa): - users (locale, notes), projects (reference/external_reference_1/country), companies (apodo/estado/logo_path), layers (color; sin geojson_data), phases (fechas), features (status/responsible_user_id + sync + softDeletes), inspection_templates (phase_id), inspections (workflow + sync + softDeletes), issues (type + sync), progress_updates/media (sync), issue_tasks (overdue), permissions (group/description) y roles (description); soft-deletes en sus creates. - Se mantienen las que dependen de orden/FK: add_profile_fields (users.company_id → companies) y update_inspections_feature_id_foreign (feature_id → features). - Eliminado database/schema/mysql-schema.sql (obsoleto): las instalaciones nuevas ejecutan las migraciones; las BD existentes no se tocan. Regenerable con schema:dump. Suite 75 passing. Esquema SQLite idéntico antes/después. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
52 lines
1.5 KiB
PHP
52 lines
1.5 KiB
PHP
<?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('users', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('name');
|
|
$table->string('email')->unique();
|
|
$table->timestamp('email_verified_at')->nullable();
|
|
$table->string('password');
|
|
$table->rememberToken();
|
|
$table->string('locale', 5)->default('es');
|
|
$table->text('notes')->nullable();
|
|
$table->timestamps();
|
|
});
|
|
|
|
Schema::create('password_reset_tokens', function (Blueprint $table) {
|
|
$table->string('email')->primary();
|
|
$table->string('token');
|
|
$table->timestamp('created_at')->nullable();
|
|
});
|
|
|
|
Schema::create('sessions', function (Blueprint $table) {
|
|
$table->string('id')->primary();
|
|
$table->foreignId('user_id')->nullable()->index();
|
|
$table->string('ip_address', 45)->nullable();
|
|
$table->text('user_agent')->nullable();
|
|
$table->longText('payload');
|
|
$table->integer('last_activity')->index();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*/
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('users');
|
|
Schema::dropIfExists('password_reset_tokens');
|
|
Schema::dropIfExists('sessions');
|
|
}
|
|
};
|