añadir nuevas funcionalidades
This commit is contained in:
@@ -15,7 +15,7 @@ return new class extends Migration
|
||||
$table->id();
|
||||
$table->string('name');
|
||||
$table->foreignId('project_id')->constrained();
|
||||
$table->foreignId('creator_id')->constrained('users');
|
||||
//$table->foreignId('creator_id')->constrained('users');
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
51
database/migrations/2025_04_29_115501_update_users_table.php
Normal file
51
database/migrations/2025_04_29_115501_update_users_table.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?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('title')->nullable()->after('id');
|
||||
$table->string('first_name')->after('title');
|
||||
$table->string('last_name')->after('first_name');
|
||||
$table->string('username')->unique()->after('last_name');
|
||||
$table->date('access_start')->nullable()->after('password');
|
||||
$table->date('access_end')->nullable()->after('access_start');
|
||||
$table->string('phone')->nullable()->after('email');
|
||||
$table->text('address')->nullable()->after('phone');
|
||||
$table->boolean('is_active')->default(true)->after('address');
|
||||
$table->string('profile_photo_path')->nullable();
|
||||
|
||||
// Eliminar campos no necesarios
|
||||
$table->dropColumn('name');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('users', function (Blueprint $table) {
|
||||
$table->dropColumn('title');
|
||||
$table->dropColumn('first_name');
|
||||
$table->dropColumn('last_name');
|
||||
$table->dropColumn('username');
|
||||
$table->dropColumn('access_start');
|
||||
$table->dropColumn('access_end');
|
||||
$table->dropColumn('phone');
|
||||
$table->dropColumn('address');
|
||||
$table->dropColumn('is_active');
|
||||
$table->dropColumn('profile_photo_path ');
|
||||
|
||||
$table->string('name')->after('id');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
<?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('documents', function (Blueprint $table) {
|
||||
$table->string('file_path')->require();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('documents', function (Blueprint $table) {
|
||||
$table->dropColumn('file_path');
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,34 @@
|
||||
<?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('document_comments', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('document_id')->constrained();
|
||||
$table->foreignId('user_id')->constrained();
|
||||
$table->foreignId('parent_id')->nullable()->constrained('document_comments');
|
||||
$table->text('content');
|
||||
$table->unsignedInteger('page');
|
||||
$table->decimal('x', 5, 3); // Posición X normalizada (0-1)
|
||||
$table->decimal('y', 5, 3); // Posición Y normalizada (0-1)
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('document_comments');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,34 @@
|
||||
<?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('comments', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->text('content');
|
||||
$table->foreignId('user_id')->constrained();
|
||||
$table->foreignId('document_id')->constrained();
|
||||
$table->foreignId('parent_id')->nullable()->constrained('comments');
|
||||
$table->unsignedInteger('page');
|
||||
$table->decimal('x', 5, 3); // Posición X (0-1)
|
||||
$table->decimal('y', 5, 3); // Posición Y (0-1)
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('comments');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user