add counter table
This commit is contained in:
parent
07eb2a04d8
commit
4c2d4e55e4
27
app/Database/Migrations/2025-09-22-155700_Counter.php
Normal file
27
app/Database/Migrations/2025-09-22-155700_Counter.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Database\Migrations;
|
||||
|
||||
use CodeIgniter\Database\Migration;
|
||||
|
||||
class CreateCounterTable extends Migration {
|
||||
public function up() {
|
||||
|
||||
$this->forge->addField([
|
||||
'CounterID' => ['type' => 'INT', 'auto_increment' => true, 'unsigned' => true],
|
||||
'CounterValue' => ['type' => 'INT', 'null' => false],
|
||||
'CounterStart' => ['type' => 'INT', 'null' => false],
|
||||
'CounterEnd' => ['type' => 'INT', 'null' => false],
|
||||
'CounterDesc' => ['type' => 'varchar', 'constraint' => 255, 'null' => true],
|
||||
'CounterReset' => ['type' => 'varchar', 'constraint' => 1, 'null' => true],
|
||||
'EndDate' => ['type' => 'DATETIME', 'null' => true]
|
||||
]);
|
||||
$this->forge->addField('CreateDate DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP');
|
||||
$this->forge->addKey('CounterID', true);
|
||||
$this->forge->createTable('counter');
|
||||
}
|
||||
|
||||
public function down() {
|
||||
$this->forge->dropTable('counter');
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user