mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
delete is_deleted field
This commit is contained in:
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use App\Models\Clientes\ClienteContactoModel;
|
||||
use App\Models\Clientes\ClienteModel;
|
||||
use App\Models\Clientes\ClientePlantillaPreciosModel;
|
||||
use App\Models\Clientes\ClientePreciosModel;
|
||||
use CodeIgniter\Database\Migration;
|
||||
use CodeIgniter\I18n\Time;
|
||||
|
||||
class DropIsDeletedField extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
|
||||
$m = $this->db->table('clientes');
|
||||
$m->where('is_deleted',1)->update(['deleted_at' => Time::now()]);
|
||||
$m->where('is_deleted',0)->update(['deleted_at' => null]);
|
||||
$this->forge->dropColumn('clientes',"is_deleted");
|
||||
|
||||
$m = $this->db->table('cliente_contactos');
|
||||
$m->where('is_deleted',1)->update(['deleted_at' => Time::now()]);
|
||||
$m->where('is_deleted',0)->update(['deleted_at' => null]);
|
||||
$this->forge->dropColumn('cliente_contactos',"is_deleted");
|
||||
|
||||
$m = $this->db->table('cliente_precios');
|
||||
$m->where('is_deleted',1)->update(['deleted_at' => Time::now()]);
|
||||
$m->where('is_deleted',0)->update(['deleted_at' => null]);
|
||||
$this->forge->dropColumn('cliente_precios',"is_deleted");
|
||||
|
||||
$m = $this->db->table('cliente_plantilla_precios_lineas');
|
||||
$m->where('is_deleted',1)->update(['deleted_at' => Time::now()]);
|
||||
$m->where('is_deleted',0)->update(['deleted_at' => null]);
|
||||
$this->forge->dropColumn('cliente_plantilla_precios_lineas',"is_deleted");
|
||||
|
||||
$m = $this->db->table('cliente_plantilla_precios');
|
||||
$m->where('is_deleted',1)->update(['deleted_at' => Time::now()]);
|
||||
$m->where('is_deleted',0)->update(['deleted_at' => null]);
|
||||
$this->forge->dropColumn('cliente_plantilla_precios',"is_deleted");
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user