Merge branch 'feat/importador_libros_catalogo_antiguo' into 'main'

Feat/importador libros catalogo antiguo

See merge request jjimenez/safekat!838
This commit is contained in:
Ignacio Martinez Navajas
2025-06-02 09:13:15 +00:00
12 changed files with 445 additions and 1913 deletions

View File

@ -0,0 +1,38 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class RenameIskToIskn extends Migration
{
public function up()
{
// Renombrar columna isk a iskn
$this->forge->modifyColumn('catalogo_libros', [
'isk' => [
'name' => 'iskn',
'type' => 'VARCHAR',
'constraint' => 64,
'null' => true,
'default' => null,
'collation' => 'utf8_unicode_ci',
],
]);
}
public function down()
{
// Revertir el nombre de iskn a isk
$this->forge->modifyColumn('catalogo_libros', [
'iskn' => [
'name' => 'isk',
'type' => 'VARCHAR',
'constraint' => 64,
'null' => true,
'default' => null,
'collation' => 'utf8_unicode_ci',
],
]);
}
}

View File

@ -0,0 +1,54 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class RenameIdentificadoresIskToIskn extends Migration
{
public function up()
{
// Renombrar la tabla
$this->db->query('RENAME TABLE identificadores_isk TO identificadores_iskn');
// Eliminar el índice único existente sobre 'isk'
$this->db->query('ALTER TABLE identificadores_iskn DROP INDEX isk');
// Renombrar la columna 'isk' a 'iskn'
$this->forge->modifyColumn('identificadores_iskn', [
'isk' => [
'name' => 'iskn',
'type' => 'VARCHAR',
'constraint' => 64,
'null' => false,
'collation' => 'utf8_general_ci',
],
]);
// Crear nuevo índice único sobre 'iskn'
$this->db->query('ALTER TABLE identificadores_iskn ADD UNIQUE INDEX iskn (iskn)');
}
public function down()
{
// Eliminar índice único sobre 'iskn'
$this->db->query('ALTER TABLE identificadores_iskn DROP INDEX iskn');
// Renombrar la columna 'iskn' de nuevo a 'isk'
$this->forge->modifyColumn('identificadores_iskn', [
'iskn' => [
'name' => 'isk',
'type' => 'VARCHAR',
'constraint' => 64,
'null' => false,
'collation' => 'utf8_general_ci',
],
]);
// Restaurar índice único sobre 'isk'
$this->db->query('ALTER TABLE identificadores_iskn ADD UNIQUE INDEX isk (isk)');
// Renombrar la tabla de nuevo a su nombre original
$this->db->query('RENAME TABLE identificadores_iskn TO identificadores_isk');
}
}

File diff suppressed because it is too large Load Diff