Carga inicial

This commit is contained in:
IvanAS94
2025-12-26 17:21:11 -08:00
parent 45d9afc951
commit 51880798ca
359 changed files with 42159 additions and 1 deletions

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableTiposEmpleados extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('tipos_empleados', function (Blueprint $table) {
$table->increments('id');
$table->string('nombre');
$table->boolean('login');
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('tipos_empleados');
}
}

View File

@@ -0,0 +1,41 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableSucursales extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sucursales', function (Blueprint $table) {
$table->increments('id');
$table->string('nombre')->unique();
$table->string('calle');
$table->string('num_ext');
$table->string('num_int')->nullable();
$table->string('colonia');
$table->string('cp');
$table->string('telefono');
$table->string('gerente');
$table->string('encargado');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('sucursales');
}
}

View File

@@ -0,0 +1,140 @@
<?php
/**
* Part of the Sentinel package.
*
* NOTICE OF LICENSE
*
* Licensed under the 3-clause BSD License.
*
* This source file is subject to the 3-clause BSD License that is
* bundled with this package in the LICENSE file.
*
* @package Sentinel
* @version 2.0.17
* @author Cartalyst LLC
* @license BSD License (3-clause)
* @copyright (c) 2011-2017, Cartalyst LLC
* @link http://cartalyst.com
*/
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
class MigrationCartalystSentinel extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('activations', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id')->unsigned();
$table->string('code');
$table->boolean('completed')->default(0);
$table->timestamp('completed_at')->nullable();
$table->timestamps();
$table->engine = 'InnoDB';
});
Schema::create('persistences', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id')->unsigned();
$table->string('code');
$table->timestamps();
$table->engine = 'InnoDB';
$table->unique('code');
});
Schema::create('reminders', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id')->unsigned();
$table->string('code');
$table->boolean('completed')->default(0);
$table->timestamp('completed_at')->nullable();
$table->timestamps();
$table->engine = 'InnoDB';
});
Schema::create('roles', function (Blueprint $table) {
$table->increments('id');
$table->string('slug');
$table->string('name');
$table->text('permissions')->nullable();
$table->timestamps();
$table->engine = 'InnoDB';
$table->unique('slug');
});
Schema::create('role_users', function (Blueprint $table) {
$table->integer('user_id')->unsigned();
$table->integer('role_id')->unsigned();
$table->nullableTimestamps();
$table->engine = 'InnoDB';
$table->primary(['user_id', 'role_id']);
});
Schema::create('throttle', function (Blueprint $table) {
$table->increments('id');
$table->integer('user_id')->unsigned()->nullable();
$table->string('type');
$table->string('ip')->nullable();
$table->timestamps();
$table->engine = 'InnoDB';
$table->index('user_id');
});
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('email');
$table->string('password');
$table->string('nombre');
$table->string('apellido_paterno');
$table->string('apellido_materno');
$table->string('telefono')->nullable();
$table->integer('sucursal_id')->unsigned();
$table->boolean('solicitar')->default(0);
$table->integer('tipo_empleado_id')->unsigned();
$table->text('permissions')->nullable();
$table->timestamp('last_login')->nullable();
$table->rememberToken();
$table->timestamps();
$table->engine = 'InnoDB';
$table->unique('email');
$table->foreign('tipo_empleado_id')
->references('id')
->on('tipos_empleados');
$table->foreign('sucursal_id')
->references('id')
->on('sucursales');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('activations');
Schema::drop('persistences');
Schema::drop('reminders');
Schema::drop('roles');
Schema::drop('role_users');
Schema::drop('throttle');
Schema::drop('users');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePasswordResetsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('password_resets', function (Blueprint $table) {
$table->string('email')->index();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('password_resets');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableUsersAddSoftdeletes extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn('deleted_at');
});
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableEstatusServicios extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cat_estatus_servicios', function (Blueprint $table) {
$table->increments('id');
$table->string('nombre');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('cat_estatus_servicios');
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableCatServicios extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cat_servicios', function (Blueprint $table) {
$table->increments('id');
$table->string('nombre');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('cat_servicios');
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableCatFormaPago extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cat_formas_pagos', function (Blueprint $table) {
$table->increments('id');
$table->string('nombre');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('cat_formas_pagos');
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableCatTipoServicio extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cat_tipos_servicios', function (Blueprint $table) {
$table->increments('id');
$table->string('nombre');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('cat_tipos_servicios');
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableRolesAddMovilWeb extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('roles', function (Blueprint $table) {
$table->boolean('movil')->after('permissions')->default(0);
$table->boolean('web')->after('movil')->default(0);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('roles', function (Blueprint $table) {
$table->dropColumn(['movil','web']);
});
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableVehiculos extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cat_vehiculos', function (Blueprint $table) {
$table->increments('id');
$table->string('num_economico')->unique();
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('cat_vehiculos');
}
}

View File

@@ -0,0 +1,41 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableVehiculosSucursales extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('vehiculos_sucursales', function (Blueprint $table) {
$table->integer('vehiculo_id')->unsigned();
$table->integer('sucursal_id')->unsigned();
$table->unique(['vehiculo_id', 'sucursal_id']);
$table->foreign('vehiculo_id')
->references('id')
->on('cat_vehiculos');
$table->foreign('sucursal_id')
->references('id')
->on('sucursales');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('vehiculos_sucursales');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableFacturaUsoCfdi extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('facturas_uso_cfdi', function (Blueprint $table) {
$table->increments('id');
$table->char('clave', 9);
$table->string('descripcion', 765);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('facturas_uso_cfdi');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableFacturaFormasPago extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('facturas_formas_pago', function (Blueprint $table) {
$table->increments('id');
$table->char('clave', 6);
$table->string('descripcion', 765);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('facturas_formas_pago');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableFacturaMetodosPago extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('facturas_metodos_pago', function (Blueprint $table) {
$table->increments('id');
$table->char('clave', 9);
$table->string('descripcion', 765);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('facturas_metodos_pago');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableFacturaTipoComprobante extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('facturas_tipo_comprobante', function (Blueprint $table) {
$table->increments('id');
$table->char('clave', 3);
$table->string('descripcion', 765);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('facturas_tipo_comprobante');
}
}

View File

@@ -0,0 +1,44 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableClientes extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('clientes', function (Blueprint $table) {
$table->increments('id');
$table->string('denominacion');
$table->integer('asesor_id')->unsigned();
$table->integer('sucursal_id')->unsigned();
$table->boolean('requiere_factura');
$table->timestamps();
$table->softDeletes();
$table->foreign('asesor_id')
->references('id')
->on('users');
$table->foreign('sucursal_id')
->references('id')
->on('sucursales');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('clientes');
}
}

View File

@@ -0,0 +1,45 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableClientesDomicilios extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('clientes_domicilios', function (Blueprint $table) {
$table->increments('id');
$table->integer('cliente_id')->unsigned();
$table->string('calle');
$table->string('num_ext');
$table->string('num_int')->nullable();
$table->string('colonia');
$table->string('cp');
$table->string('telefono')->nullable();
$table->double('lat')->nullable();
$table->double('lng')->nullable();
$table->timestamps();
$table->softDeletes();
$table->foreign('cliente_id')
->references('id')
->on('clientes');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('clientes_domicilios');
}
}

View File

@@ -0,0 +1,71 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableClientesDatosFiscales extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('clientes_datos_fiscales', function (Blueprint $table) {
$table->increments('id');
$table->integer('cliente_id')->unsigned()->unique();
$table->string('razon_social');
$table->string('rfc');
$table->string('email');
$table->string('calle');
$table->string('num_ext');
$table->string('num_int')->nullable();
$table->string('colonia');
$table->string('localidad');
$table->string('municipio');
$table->string('estado');
$table->string('pais');
$table->string('cp');
$table->integer('factura_uso_cfdi_id')->unsigned();
$table->integer('factura_tipo_comprobante_id')->unsigned();
$table->integer('factura_metodos_pago_id')->unsigned();
$table->integer('factura_formas_pago_id')->unsigned();
$table->string('condicion_pago');
$table->boolean('retencion_iva');
$table->string('observacion',250)->nullable();
$table->timestamps();
$table->foreign('cliente_id')
->references('id')
->on('clientes');
$table->foreign('factura_uso_cfdi_id')
->references('id')
->on('facturas_uso_cfdi');
$table->foreign('factura_tipo_comprobante_id')
->references('id')
->on('facturas_tipo_comprobante');
$table->foreign('factura_metodos_pago_id')
->references('id')
->on('facturas_metodos_pago');
$table->foreign('factura_formas_pago_id')
->references('id')
->on('facturas_formas_pago');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('clientes_datos_fiscales');
}
}

View File

@@ -0,0 +1,81 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableServicios extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('servicios', function (Blueprint $table) {
$table->increments('id');
$table->integer('servicio_id')->unsigned();
$table->integer('estatus_servicio_id')->unsigned();
$table->integer('forma_pago_id')->unsigned();
$table->integer('tipo_servicio_id')->unsigned();
$table->dateTime('fecha_agenda');
$table->dateTime('fecha_solicitud');
$table->integer('usuario_agenda_id')->unsigned();
$table->time('duracion');
$table->boolean('definido_cliente');
$table->integer('cliente_id')->unsigned();
$table->integer('cliente_domicilio_id')->unsigned();
$table->integer('operador_id')->unsigned();
$table->integer('vehiculo_id')->unsigned();
$table->timestamps();
$table->softDeletes();
$table->foreign('servicio_id')
->references('id')
->on('cat_servicios');
$table->foreign('estatus_servicio_id')
->references('id')
->on('cat_estatus_servicios');
$table->foreign('forma_pago_id')
->references('id')
->on('cat_formas_pagos');
$table->foreign('tipo_servicio_id')
->references('id')
->on('cat_tipos_servicios');
$table->foreign('usuario_agenda_id')
->references('id')
->on('users');
$table->foreign('cliente_id')
->references('id')
->on('clientes');
$table->foreign('cliente_domicilio_id')
->references('id')
->on('clientes_domicilios');
$table->foreign('operador_id')
->references('id')
->on('users');
$table->foreign('vehiculo_id')
->references('id')
->on('cat_vehiculos');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('servicios');
}
}

View File

@@ -0,0 +1,49 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableBitacoraLaboral extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('bitacora_laboral', function (Blueprint $table) {
$table->increments('id');
$table->integer('usuario_id')->unsigned();
$table->integer('vehiculo_id')->nullable()->unsigned();
$table->dateTime('fecha_hora_ini');
$table->dateTime('fecha_hora_fin')->nullable();
$table->integer('kilometraje_inicial');
$table->integer('kilometraje_final')->nullable();
$table->double('lat_ini');
$table->double('lng_ini');
$table->double('lat_fin')->nullable();
$table->double('lng_fin')->nullable();
$table->timestamps();
$table->foreign('usuario_id')
->references('id')
->on('users');
$table->foreign('vehiculo_id')
->references('id')
->on('cat_vehiculos');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('bitacora_laboral');
}
}

View File

@@ -0,0 +1,46 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableUsuariosDesplazamientos extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('usuarios_desplazamientos', function (Blueprint $table) {
$table->bigIncrements('id');
$table->integer('bitacora_laboral_id')->unsigned();
$table->integer('usuario_id')->unsigned();
$table->dateTime('fecha');
$table->string('modelo_celular');
$table->integer('bateria');
$table->double('lat');
$table->double('lng');
$table->timestamps();
$table->foreign('usuario_id')
->references('id')
->on('users');
$table->foreign('bitacora_laboral_id')
->references('id')
->on('bitacora_laboral');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('usuarios_desplazamientos');
}
}

View File

@@ -0,0 +1,31 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableParametros extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('parametros', function (Blueprint $table) {
$table->string('llave');
$table->string('valor');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('parametros');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableUsersAddTokenFirebase extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->string('token_firebase',255)->nullable()->after('permissions');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn(['token_firebase']);
});
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableClientesDomiciliosAddNombreSucursal extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('clientes_domicilios', function (Blueprint $table) {
$table->string('nombre_sucursal')->after('cliente_id');
$table->integer('numero_sucursal')->after('nombre_sucursal');
$table->string('nombre_responsable_sucursal')->after('numero_sucursal');
$table->string('entre_calles')->nullable()->after('calle');
$table->string('ciudad')->after('colonia');
$table->string('celular_responsable')->after('telefono');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('clientes_domicilios', function (Blueprint $table) {
$table->dropColumn(['nombre_sucursal', 'numero_sucursal', 'nombre_responsable_sucursal', 'entre_calles', 'ciudad', 'celular_responsable']);
});
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableCatTiposVehiculos extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cat_tipos_vehiculos', function (Blueprint $table) {
$table->increments('id');
$table->string('nombre');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('cat_tipos_vehiculos');
}
}

View File

@@ -0,0 +1,38 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableCatVehiculosAddTipoVehiculoId extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('cat_vehiculos', function (Blueprint $table) {
$table->integer('tipo_vehiculo_id')->after('num_economico')->unsigned();
$table->foreign('tipo_vehiculo_id')
->references('id')
->on('cat_tipos_vehiculos');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('cat_vehiculos', function (Blueprint $table) {
$table->dropForeign(['tipo_vehiculo_id']);
$table->dropColumn(['tipo_vehiculo_id']);
});
}
}

View File

@@ -0,0 +1,42 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableServiciosAddAux1Aux2 extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('servicios', function (Blueprint $table) {
$table->integer('auxiliar_1')->nullable()->unsigned()->after('vehiculo_id');
$table->integer('auxiliar_2')->nullable()->unsigned()->after('auxiliar_1');
$table->foreign('auxiliar_1')
->references('id')
->on('users');
$table->foreign('auxiliar_2')
->references('id')
->on('users');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('servicios', function (Blueprint $table) {
$table->dropForeign(['auxiliar_1', 'auxiliar_2']);
$table->dropColumn(['auxiliar_1', 'auxiliar_2']);
});
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableCatEstatusServiciosAddColores extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('cat_estatus_servicios', function (Blueprint $table) {
$table->string('color_1',10)->nullable()->after('nombre');
$table->string('color_2',10)->nullable()->after('color_1');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('cat_estatus_servicios', function (Blueprint $table) {
$table->dropColumn(['color_1', 'color_2']);
});
}
}

View File

@@ -0,0 +1,61 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableServiciosEnc extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::dropIfExists('servicios');
Schema::create('servicios_enc', function (Blueprint $table) {
$table->increments('id');
$table->integer('forma_pago_id')->unsigned();
$table->dateTime('fecha_agenda');
$table->integer('usuario_agenda_id')->unsigned();
$table->integer('cliente_id')->unsigned();
$table->integer('cliente_domicilio_id')->unsigned();
$table->integer('sucursal_id')->unsigned();
$table->timestamps();
$table->softDeletes();
$table->foreign('forma_pago_id')
->references('id')
->on('cat_formas_pagos');
$table->foreign('usuario_agenda_id')
->references('id')
->on('users');
$table->foreign('cliente_id')
->references('id')
->on('clientes');
$table->foreign('cliente_domicilio_id')
->references('id')
->on('clientes_domicilios');
$table->foreign('sucursal_id')
->references('id')
->on('sucursales');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('servicios_enc');
}
}

View File

@@ -0,0 +1,75 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableServiciosDet extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('servicios_det', function (Blueprint $table) {
$table->increments('id');
$table->integer('servicio_enc_id')->unsigned();
$table->integer('servicio_id')->unsigned();
$table->integer('estatus_servicio_id')->unsigned();
$table->integer('tipo_servicio_id')->unsigned();
$table->dateTime('fecha_solicitud');
$table->time('duracion');
$table->boolean('definido_cliente');
$table->decimal('costo_servicio',14,2);
$table->integer('operador_id')->nullable()->unsigned();
$table->integer('vehiculo_id')->nullable()->unsigned();
$table->integer('auxiliar_1')->nullable()->unsigned();
$table->integer('auxiliar_2')->nullable()->unsigned();
$table->timestamps();
$table->foreign('servicio_enc_id')
->references('id')
->on('servicios_enc');
$table->foreign('auxiliar_1')
->references('id')
->on('users');
$table->foreign('auxiliar_2')
->references('id')
->on('users');
$table->foreign('servicio_id')
->references('id')
->on('cat_servicios');
$table->foreign('estatus_servicio_id')
->references('id')
->on('cat_estatus_servicios');
$table->foreign('tipo_servicio_id')
->references('id')
->on('cat_tipos_servicios');
$table->foreign('operador_id')
->references('id')
->on('users');
$table->foreign('vehiculo_id')
->references('id')
->on('cat_vehiculos');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('servicios_det');
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableServiciosDetAddAceptado extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('servicios_det', function (Blueprint $table) {
$table->boolean('aceptado')->nullable()->after('auxiliar_2');
$table->string('observacion',255)->nullable()->after('aceptado');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('servicios_det', function (Blueprint $table) {
$table->dropColumn(['aceptado', 'observacion']);
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableServiciosDetAddObservacion extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('servicios_det', function (Blueprint $table) {
$table->string('observacion_atencion_cliente',255)->nullable()->after('observacion');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('servicios_det', function (Blueprint $table) {
$table->dropColumn(['observacion_atencion_cliente']);
});
}
}

View File

@@ -0,0 +1,53 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableServiciosProgreso extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('servicios_progreso', function (Blueprint $table) {
$table->increments('id');
$table->integer('servicio_enc_id')->unsigned();
$table->integer('servicio_det_id')->unsigned();
$table->dateTime('fecha_ini_servidor');
$table->dateTime('fecha_fin_servidor')->nullable();
$table->dateTime('fecha_ini_celular');
$table->dateTime('fecha_fin_celular')->nullable();
$table->time('duracion')->nullable();
$table->double('lat_ini');
$table->double('lng_ini');
$table->double('lat_fin')->nullable();
$table->double('lng_fin')->nullable();
$table->string('comentarios', 255)->nullable();
$table->timestamps();
$table->foreign('servicio_enc_id')
->references('id')
->on('servicios_enc');
$table->foreign('servicio_det_id')
->references('id')
->on('servicios_det');
$table->unique(['servicio_enc_id', 'servicio_det_id']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('servicios_progreso');
}
}

View File

@@ -0,0 +1,41 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableServiciosEvidencias extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('servicios_evidencias', function (Blueprint $table) {
$table->increments('id');
$table->integer('servicio_progreso_id')->unsigned();
$table->string('imagen', 255)->nullable();
$table->string('uuid', 255);
$table->enum('etapa', ['Inicio', 'Proceso', 'Final']);
$table->double('lat');
$table->double('lng');
$table->timestamps();
$table->foreign('servicio_progreso_id')
->references('id')
->on('servicios_progreso');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('servicios_evidencias');
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableServiciosProgresoAddFirma extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('servicios_progreso', function (Blueprint $table) {
$table->string('firma',255)->nullable()->after('comentarios');
$table->string('pdf',255)->nullable()->after('firma');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('servicios_progreso', function (Blueprint $table) {
$table->dropColumn(['firma', 'pdf']);
});
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableCatOrigenes extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cat_origenes', function (Blueprint $table) {
$table->increments('id');
$table->string('nombre');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('cat_origenes');
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableServiciosEncAddOrigenId extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('servicios_enc', function (Blueprint $table) {
$table->integer('origen_id')->unsigned()->after('sucursal_id');
$table->foreign('origen_id')
->references('id')
->on('cat_origenes');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('servicios_enc', function (Blueprint $table) {
$table->dropForeign(['origen_id']);
$table->dropColumn(['origen_id']);
});
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTablePreguntasEmpresarial extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('preguntas_empresarial', function (Blueprint $table) {
$table->increments('id');
$table->string('nombre');
$table->integer('orden');
$table->boolean('mostrar_numero');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('preguntas_empresarial');
}
}

View File

@@ -0,0 +1,40 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableRespuestasEmpresarial extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('respuestas_empresarial', function (Blueprint $table) {
$table->increments('id');
$table->integer('pregunta_id')->unsigned();
$table->string('nombre');
$table->integer('orden');
$table->enum('tipo_campo', ['Texto', 'Email', 'Fecha', 'Checkbox']);
$table->timestamps();
$table->softDeletes();
$table->foreign('pregunta_id')
->references('id')
->on('preguntas_empresarial');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('respuestas_empresarial');
}
}

View File

@@ -0,0 +1,35 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTablePreguntasDomestico extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('preguntas_domestico', function (Blueprint $table) {
$table->increments('id');
$table->string('nombre');
$table->integer('orden');
$table->boolean('mostrar_numero');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('preguntas_domestico');
}
}

View File

@@ -0,0 +1,40 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableRespuestasDomestico extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('respuestas_domestico', function (Blueprint $table) {
$table->increments('id');
$table->integer('pregunta_id')->unsigned();
$table->string('nombre');
$table->integer('orden');
$table->enum('tipo_campo', ['Texto', 'Email', 'Fecha', 'Checkbox']);
$table->timestamps();
$table->softDeletes();
$table->foreign('pregunta_id')
->references('id')
->on('preguntas_domestico');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('respuestas_domestico');
}
}

View File

@@ -0,0 +1,48 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableServiciosEncuestasDomestico extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('servicios_encuestas_domestico', function (Blueprint $table) {
$table->increments('id');
$table->integer('servicio_det_id')->unsigned();
$table->integer('pregunta_id')->unsigned();
$table->integer('respuesta_id')->nullable()->unsigned();
$table->string('respuesta')->nullable();
$table->timestamps();
$table->softDeletes();
$table->foreign('servicio_det_id')
->references('id')
->on('servicios_det');
$table->foreign('pregunta_id')
->references('id')
->on('preguntas_domestico');
$table->foreign('respuesta_id')
->references('id')
->on('respuestas_domestico');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('servicios_encuestas_domestico');
}
}

View File

@@ -0,0 +1,48 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableServiciosEncuestasEmpresarial extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('servicios_encuestas_empresarial', function (Blueprint $table) {
$table->increments('id');
$table->integer('servicio_det_id')->unsigned();
$table->integer('pregunta_id')->unsigned();
$table->integer('respuesta_id')->nullable()->unsigned();
$table->string('respuesta')->nullable();
$table->timestamps();
$table->softDeletes();
$table->foreign('servicio_det_id')
->references('id')
->on('servicios_det');
$table->foreign('pregunta_id')
->references('id')
->on('preguntas_empresarial');
$table->foreign('respuesta_id')
->references('id')
->on('respuestas_empresarial');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('servicios_encuestas_empresarial');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableServiciosDetAddRequiereEncuesta extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('servicios_det', function (Blueprint $table) {
$table->boolean('requiere_encuesta')->after('observacion_atencion_cliente');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('servicios_det', function (Blueprint $table) {
$table->dropColumn(['requiere_encuesta']);
});
}
}

View File

@@ -0,0 +1,42 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableBitacoraLaboralNullable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('bitacora_laboral', function (Blueprint $table) {
$table->dropColumn('fecha_hora_ini');
$table->dropColumn('kilometraje_inicial');
$table->dropColumn('lat_ini');
$table->dropColumn('lng_ini');
});
Schema::table('bitacora_laboral', function (Blueprint $table) {
$table->dateTime('fecha_hora_ini')->nullable()->after('vehiculo_id');
$table->integer('kilometraje_inicial')->nullable()->after('fecha_hora_fin');
$table->double('lat_ini')->nullable()->after('kilometraje_final');
$table->double('lng_ini')->nullable()->after('lat_ini');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}

View File

@@ -0,0 +1,42 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableRespuestasDomesticoAddEnum extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('respuestas_domestico', function (Blueprint $table) {
$table->dropColumn('tipo_campo');
});
Schema::table('respuestas_empresarial', function (Blueprint $table) {
$table->dropColumn('tipo_campo');
});
Schema::table('respuestas_domestico', function (Blueprint $table) {
$table->enum('tipo_campo', ['Texto', 'Email', 'Fecha', 'Checkbox', 'Numero', 'Moneda'])->after('orden');
});
Schema::table('respuestas_empresarial', function (Blueprint $table) {
$table->enum('tipo_campo', ['Texto', 'Email', 'Fecha', 'Checkbox', 'Numero', 'Moneda'])->after('orden');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
//
}
}

View File

@@ -0,0 +1,40 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableRespuestasDomesticoRespuestasEmpresarialAddPuntuacion extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('respuestas_domestico', function (Blueprint $table) {
$table->integer('puntuacion')->nullable()->after('tipo_campo');
});
Schema::table('respuestas_empresarial', function (Blueprint $table) {
$table->integer('puntuacion')->nullable()->after('tipo_campo');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('respuestas_domestico', function (Blueprint $table) {
$table->dropColumn('puntuacion');
});
Schema::table('respuestas_empresarial', function (Blueprint $table) {
$table->dropColumn('puntuacion');
});
}
}

View File

@@ -0,0 +1,30 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableClientesDomiciliosChangeCpNull extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('clientes_domicilios', function (Blueprint $table) {
$table->string('cp')->nullable()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
}
}

View File

@@ -0,0 +1,40 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableClientesClientesDomiciliosAddEmail extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('clientes', function (Blueprint $table) {
$table->string('email')->nullable()->after('requiere_factura');
});
Schema::table('clientes_domicilios', function (Blueprint $table) {
$table->string('email')->nullable()->after('lng');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('clientes', function (Blueprint $table) {
$table->dropColumn(['email']);
});
Schema::table('clientes_domicilios', function (Blueprint $table) {
$table->dropColumn(['email']);
});
}
}

View File

@@ -0,0 +1,40 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTablePreguntasEmpresarialPreguntasDomesticoAddObligatorio extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('preguntas_domestico', function (Blueprint $table) {
$table->boolean('obligatorio')->default(1)->after('mostrar_numero');
});
Schema::table('preguntas_empresarial', function (Blueprint $table) {
$table->boolean('obligatorio')->default(1)->after('mostrar_numero');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('preguntas_domestico', function (Blueprint $table) {
$table->dropColumn('obligatorio');
});
Schema::table('preguntas_empresarial', function (Blueprint $table) {
$table->dropColumn('obligatorio');
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableServiciosProgresoAddAplicaGarantia extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('servicios_progreso', function (Blueprint $table) {
$table->boolean('aplica_garantia')->default(false)->after('pdf');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('servicios_progreso', function (Blueprint $table) {
$table->dropColumn(['aplica_garantia']);
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableCatTiposVehiculosAddObjetivoMensual extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('cat_tipos_vehiculos', function (Blueprint $table) {
$table->integer('objetivo_mensual')->default(0)->after('nombre');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('cat_tipos_vehiculos', function (Blueprint $table) {
$table->dropColumn(['objetivo_mensual']);
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableCatVehiculosAddDescripcion extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('cat_vehiculos', function (Blueprint $table) {
$table->string('descripcion', 100)->nullable()->after('num_economico');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('cat_vehiculos', function (Blueprint $table) {
$table->dropColumn(['descripcion']);
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableCatFormasPagosAddPermitezero extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('cat_formas_pagos', function (Blueprint $table) {
$table->char('zeros', 1)->default('0')->nullable()->after('nombre');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('cat_formas_pagos', function (Blueprint $table) {
$table->dropColumn(['zeros']);
});
}
}

View File

@@ -0,0 +1,47 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableRespuestasOperador extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('respuestas_operador', function (Blueprint $table)
{
$table->increments('id');
$table->integer('user_id')->unsigned();
$table->string('nombre');
$table->enum('tipo', ['REVISION', 'MATERIAL','HERRAMIENTAS']);
$table->boolean('tipo_checkbox');
$table->boolean('tipo_text');
$table->boolean('tipo_radio_btn');
$table->boolean('respuesta_checkbox');
$table->string('respuesta_text');
$table->string('respuesta_radio_btn');
$table->date('fecha');
$table->timestamps();
$table->foreign('user_id')
->references('id')
->on('users');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('respuestas_operador');
}
}

View File

@@ -0,0 +1,61 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableRespuestasOperadorReestructuracion extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::dropIfExists('respuestas_operador');
Schema::create('respuestas_operador_enc', function (Blueprint $table)
{
$table->increments('id');
$table->integer('user_id')->unsigned();
$table->date('fecha');
$table->timestamps();
$table->foreign('user_id')
->references('id')
->on('users');
});
Schema::create('respuestas_operador_det', function (Blueprint $table)
{
$table->increments('id');
$table->integer('respuestas_operador_enc_id')->unsigned();
$table->string('nombre');
$table->enum('tipo', ['REVISION', 'MATERIAL','HERRAMIENTA']);
$table->boolean('tipo_checkbox');
$table->boolean('tipo_text');
$table->boolean('tipo_radio_btn');
$table->boolean('respuesta_checkbox')->nullable();
$table->string('respuesta_text')->nullable();
$table->string('respuesta_radio_btn')->nullable();
$table->timestamps();
$table->foreign('respuestas_operador_enc_id')
->references('id')
->on('respuestas_operador_enc');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('respuestas_operador_det');
Schema::dropIfExists('respuestas_operador_enc');
}
}

View File

@@ -0,0 +1,40 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableServiciosEncuestasDomesticoServiciosEncuestasEmpresarialChangeLenght extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('servicios_encuestas_domestico', function (Blueprint $table) {
$table->string('respuesta', 255)->nullable()->change();
});
Schema::table('servicios_encuestas_empresarial', function (Blueprint $table) {
$table->string('respuesta', 255)->nullable()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('servicios_encuestas_domestico', function (Blueprint $table) {
$table->string('respuesta', 255)->nullable()->change();
});
Schema::table('servicios_encuestas_empresarial', function (Blueprint $table) {
$table->string('respuesta', 255)->nullable()->change();
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableUsersAddPermisosEspeciales extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->boolean('permiso_especial')->default(0)->after('permissions');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn(['permiso_especial']);
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableServiciosProgresoAddLitraje extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('servicios_progreso', function (Blueprint $table) {
$table->integer('litraje')->nullable()->after('aplica_garantia');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('servicios_progreso', function (Blueprint $table) {
$table->dropColumn(['litraje']);
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableServiciosDetAddFacturado extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('servicios_det', function (Blueprint $table) {
$table->boolean('facturado')->default(0)->after('requiere_encuesta');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('servicios_det', function (Blueprint $table) {
$table->dropColumn(['facturado']);
});
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableCatMotivosEstatusNegativo extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('cat_motivos_estatus', function (Blueprint $table) {
$table->increments('id');
$table->string('nombre');
$table->timestamps();
$table->softDeletes();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('cat_motivos_estatus');
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableServiciosDetAddIdCatMotivosEstatus extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('servicios_det', function (Blueprint $table) {
$table->integer('cat_motivos_estatus_id')->unsigned()->nullable()->after('estatus_servicio_id');
$table->foreign('cat_motivos_estatus_id')
->references('id')
->on('cat_motivos_estatus');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('servicios_det', function (Blueprint $table) {
$table->dropForeign(['cat_motivos_estatus_id']);
$table->dropColumn(['cat_motivos_estatus_id']);
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableServiciosProgresoAddTypeText extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('servicios_progreso', function (Blueprint $table) {
$table->text('comentarios')->nullable()->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('servicios_progreso', function (Blueprint $table) {
$table->text('comentarios')->nullable()->change();
});
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddDispositivoIdToUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('users', function (Blueprint $table) {
$table->text('dispositivo_id')->nullable()->after('token_firebase');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('users', function (Blueprint $table) {
$table->dropColumn(['dispositivo_id']);
});
}
}

View File

@@ -0,0 +1,44 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableVehiculosIncidencias extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('vehiculos_incidencias', function (Blueprint $table) {
$table->increments('id');
$table->integer('vehiculo_id')->unsigned();
$table->integer('user_id')->unsigned();
$table->string('descripcion');
$table->boolean('resuelta')->default(false);
$table->timestamps();
$table->softDeletes();
$table->foreign('vehiculo_id')
->references('id')
->on('cat_vehiculos');
$table->foreign('user_id')
->references('id')
->on('users');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('vehiculos_incidencias');
}
}

View File

@@ -0,0 +1,33 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableServiciosProgresoAddEncuestaContestada extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('servicios_progreso', function (Blueprint $table) {
$table->boolean('encuesta_contestada')->default(false)->after('servicio_negativo');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('servicios_progreso', function (Blueprint $table) {
$table->dropColumn(['encuesta_contestada']);
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableServiciosDetChangeObservacionAtencionCliente extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('servicios_det', function (Blueprint $table) {
$table->text('observacion_atencion_cliente')->change();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('servicios_det', function (Blueprint $table) {
$table->string('observacion_atencion_cliente')->change();
});
}
}

View File

@@ -0,0 +1,40 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersLoginsLogsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users_logins_logs', function (Blueprint $table) {
$table->bigIncrements('id');
$table->unsignedInteger('user_id');
$table->string('device_info')->nullable();
$table->string('browser_info')->nullable();
$table->string('ip')->nullable();
$table->string('request_uri')->nullable();
$table->timestamps();
$table->foreign('user_id')
->references('id')
->on('users');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users_logins_logs');
}
}

View File

@@ -0,0 +1,37 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableCorreosSucursales extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('correos_sucursales', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('email');
$table->unsignedInteger('sucursal_id');
$table->timestamps();
$table->foreign('sucursal_id')
->references('id')
->on('sucursales');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('correos_sucursales');
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableSucursalesAddCostoNegativo extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('sucursales', function (Blueprint $table) {
$table->decimal('costo_negativo', 14,2)->after('encargado')->default('350');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('sucursales', function (Blueprint $table) {
$table->dropColumn('costo_negativo');
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableClientesDomiciliosAddNombreCroquis extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('clientes_domicilios', function (Blueprint $table) {
$table->string('nombre_croquis')->after('email')->nullable();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('clientes_domicilios', function (Blueprint $table) {
$table->dropColumn('nombre_croquis');
});
}
}

View File

@@ -0,0 +1,32 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AlterTableCatEstatusServiciosAddColorWeb extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('cat_estatus_servicios', function (Blueprint $table) {
$table->string('color_web', 10)->after('color_2')->default("#D1E8FF");
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('cat_estatus_servicios', function (Blueprint $table) {
$table->dropColumn('color_web');
});
}
}