mirror of
https://code.castopod.org/adaures/castopod
synced 2025-05-22 18:12:01 +00:00

- update CI process to include quality stage (tests + code review) - add captainhook to install git pre-commit & pre-push hooks - remove .devcontainer Dockerfile to use project's docker-compose services: all services can now be started automatically using vscode - update docs/setup-development.md
67 lines
1.5 KiB
PHP
67 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace Tests\Support\Database\Migrations;
|
|
|
|
use CodeIgniter\Database\Migration;
|
|
|
|
class ExampleMigration extends Migration
|
|
{
|
|
/**
|
|
* @var string
|
|
*/
|
|
protected $DBGroup = 'tests';
|
|
|
|
public function up(): void
|
|
{
|
|
$fields = [
|
|
'name' => [
|
|
'type' => 'varchar',
|
|
'constraint' => 31,
|
|
],
|
|
'uid' => [
|
|
'type' => 'varchar',
|
|
'constraint' => 31,
|
|
],
|
|
'class' => [
|
|
'type' => 'varchar',
|
|
'constraint' => 63,
|
|
],
|
|
'icon' => [
|
|
'type' => 'varchar',
|
|
'constraint' => 31,
|
|
],
|
|
'summary' => [
|
|
'type' => 'varchar',
|
|
'constraint' => 255,
|
|
],
|
|
'created_at' => [
|
|
'type' => 'datetime',
|
|
'null' => true,
|
|
],
|
|
'updated_at' => [
|
|
'type' => 'datetime',
|
|
'null' => true,
|
|
],
|
|
'deleted_at' => [
|
|
'type' => 'datetime',
|
|
'null' => true,
|
|
],
|
|
];
|
|
|
|
$this->forge->addField('id');
|
|
$this->forge->addField($fields);
|
|
|
|
$this->forge->addKey('name');
|
|
$this->forge->addKey('uid');
|
|
$this->forge->addKey(['deleted_at', 'id']);
|
|
$this->forge->addKey('created_at');
|
|
|
|
$this->forge->createTable('factories');
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
$this->forge->dropTable('factories');
|
|
}
|
|
}
|