0% found this document useful (0 votes)
26 views2 pages

Database Schema for Process Management

The document outlines the schema for three database tables: 'processes', 'process_steps', and 'process_activities'. Each table includes various fields such as IDs, foreign keys, names, descriptions, statuses, and timestamps, with specific questions highlighted regarding code generation and default values for certain fields. Additionally, indexes are created for efficient querying based on relevant columns.

Uploaded by

reof1922
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views2 pages

Database Schema for Process Management

The document outlines the schema for three database tables: 'processes', 'process_steps', and 'process_activities'. Each table includes various fields such as IDs, foreign keys, names, descriptions, statuses, and timestamps, with specific questions highlighted regarding code generation and default values for certain fields. Additionally, indexes are created for efficient querying based on relevant columns.

Uploaded by

reof1922
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Campos por tabla:

Los caracteres resaltados simbolizan preguntas que se deben realizar

Process:

Schema::create('processes', function (Blueprint $table) {


$table->id();
$table->foreignId('branch_id')->nullable()->constrained();
$table->foreignId('dependency_id')->nullable()->constrained();
$table->string('code')->unique()->nullable(); // this code can be generated by the
system or by the user?
$table->string('name');
$table->string('description')->nullable();
$table->string('status')->default('active');
$table->foreignId('created_by')->nullable()->constrained('users');
$table->foreignId('updated_by')->nullable()->constrained('users');
$table->timestamps();
$table->softDeletes();

//indexes
$table->index(['name', 'branch_id', 'dependency_id']);
});
Process_steps:

Schema::create('process_steps', function (Blueprint $table) {


$table->id();
$table->foreignId('process_id')->constrained();
$table->string('code')->nullable()->unique(); // Is this code generated by the system or
by the user?
$table->foreignId('name');
$table->string('description')->nullable();
$table->integer('duration'); // Duration in days, hours?
$table->string('duration_type')->default('Habil'); // what is the default value? //
Duration type, e.g., 'Habil', 'Calendario'?
$table->string('status')->default('active');
$table->foreignId('created_by')->nullable()->constrained('users');
$table->foreignId('updated_by')->nullable()->constrained('users');
$table->timestamps();
$table->softDeletes();

//indexes
$table->index(['process_id', 'name']);
});

Process_Activities:
Schema::create('process_activities', function (Blueprint $table) {
$table->id();
$table->foreignId('process_step_id')->constrained();
$table->string('name');
$table->string('description')->nullable();
$table->string('duration')->nullable();
$table->integer('order')->nullable();
$table->integer('days_green')->nullable();
$table->integer('days_yellow')->nullable();
$table->integer('days_red')->nullable();
$table->string('duration_type')->nullable()->default('Habil'); // what is the default
value? // Duration type, e.g., 'Habil', 'Calendario'?
$table->string('status')->default('active');
$table->foreignId('created_by')->nullable()->constrained('users');
$table->foreignId('updated_by')->nullable()->constrained('users');
$table->timestamps();
$table->softDeletes();
});

You might also like