2022-10-15 13:22:08 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace App\Database\Migrations;
|
|
|
|
|
|
|
|
use CodeIgniter\Database\Migration;
|
|
|
|
|
2022-10-19 13:02:05 +02:00
|
|
|
class AddIsOwnerToUsers extends Migration
|
2022-10-15 13:22:08 +02:00
|
|
|
{
|
|
|
|
public function up(): void
|
|
|
|
{
|
|
|
|
$fields = [
|
|
|
|
'is_owner' => [
|
2023-06-12 16:47:38 +02:00
|
|
|
'type' => 'TINYINT',
|
2022-10-15 13:22:08 +02:00
|
|
|
'constraint' => 1,
|
2023-06-12 16:47:38 +02:00
|
|
|
'default' => 0,
|
|
|
|
'null' => false,
|
2022-10-15 13:22:08 +02:00
|
|
|
],
|
|
|
|
];
|
|
|
|
|
|
|
|
$this->forge->addColumn('users', $fields);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function down(): void
|
|
|
|
{
|
|
|
|
$fields = ['is_owner'];
|
|
|
|
$this->forge->dropColumn('users', $fields);
|
|
|
|
}
|
|
|
|
}
|