mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
Avances
This commit is contained in:
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
|
||||
class CreateBackupsTable extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
$this->forge->addField([
|
||||
'id' => [
|
||||
'type' => 'INT',
|
||||
'unsigned' => true,
|
||||
'auto_increment' => true
|
||||
],
|
||||
'filename' => ['type' => 'VARCHAR', 'constraint' => 255],
|
||||
'type' => ['type' => 'ENUM', 'constraint' => ['manual', 'cron']],
|
||||
'path_local' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'path_remote' => ['type' => 'VARCHAR', 'constraint' => 255, 'null' => true],
|
||||
'size' => ['type' => 'INT', 'unsigned' => true, 'null' => true],
|
||||
'status' => ['type' => 'ENUM', 'constraint' => ['pendiente', 'subido', 'error'], 'default' => 'pendiente'],
|
||||
'created_at' => ['type' => 'DATETIME', 'null' => false],
|
||||
'updated_at' => ['type' => 'DATETIME', 'null' => true],
|
||||
]);
|
||||
$this->forge->addKey('id', true);
|
||||
$this->forge->createTable('backups');
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->forge->dropTable('backups');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user