MIF_E31210104/app/Database/Migrations/2024-04-22-233948_Paket.php

49 lines
1.2 KiB
PHP

<?php
namespace App\Database\Migrations;
use CodeIgniter\Database\Migration;
use CodeIgniter\Database\RawSql;
class Paket extends Migration
{
public function up()
{
$this->forge->addField([
'id' => [
'type' => 'INT',
'constraint' => 11,
'unsigned' => true,
'auto_increment' => true,
],
'nama' => [
'type' => 'VARCHAR',
'constraint' => 255,
],
'kecepatan' => [
'type' => 'VARCHAR',
'constraint' => 255,
],
'harga' => [
'type' => 'VARCHAR',
'constraint' => 255,
],
'created_at' => [
'type' => 'TIMESTAMP',
'default' => new RawSql('CURRENT_TIMESTAMP'),
],
'updated_at' => [
'type' => 'TIMESTAMP',
'default' => new RawSql('CURRENT_TIMESTAMP'),
],
]);
$this->forge->addKey('id', true);
$this->forge->createTable('paket');
}
public function down()
{
$this->forge->dropTable('paket');
}
}