This commit is contained in:
imnavajas
2025-06-09 15:18:12 +02:00
parent e53626bbfe
commit 6967a61d93
6 changed files with 258 additions and 33 deletions

View File

@ -0,0 +1,26 @@
<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
class CreateRestoresTable extends Migration
{
public function up()
{
$this->forge->addField([
'id' => ['type' => 'INT', 'unsigned' => true, 'auto_increment' => true],
'backup_id' => ['type' => 'INT', 'unsigned' => true],
'restored_by' => ['type' => 'VARCHAR', 'constraint' => 100],
'source' => ['type' => 'ENUM', 'constraint' => ['local', 'remote']],
'restored_at' => ['type' => 'DATETIME'],
]);
$this->forge->addKey('id', true);
$this->forge->addForeignKey('backup_id', 'backups', 'id', 'CASCADE', 'CASCADE');
$this->forge->createTable('restores');
}
public function down()
{
$this->forge->dropTable('restores');
}
}