<?php

namespace App\Database\Migrations;

use CodeIgniter\Database\Migration;

class Setup extends Migration
{
    public function up()
    {
        $this->forge->addField([
            'id' => [
                'type' => 'int',
                'constraint' => 11,
                'unsigned' => true,
                'auto_increment' => true
            ],
            'email' => [
                'type' => 'VARCHAR',
                'constraint' => '60',
            ],
            'street' => [
                'type' => 'VARCHAR',
                'constraint' => '32',
            ],
            'district' => [
                'type' => 'VARCHAR',
                'constraint' => '32',
            ],
            'region' => [
                'type' => 'VARCHAR',
                'constraint' => '32',
            ],
            'phone' => [
                'type' => 'VARCHAR',
                'constraint' => '10',
            ],

            'opening_hrs_mon_sat' => [
                'type' => 'VARCHAR',
                'constraint' => '32',
            ],
            'opening_hrs_sun' => [
                'type' => 'VARCHAR',
                'constraint' => '32',
            ],

            'twitter' => [
                'type' => 'VARCHAR',
                'constraint' => '255',
            ],
            'facebook' => [
                'type' => 'VARCHAR',
                'constraint' => '255',
            ],
            'instagram' => [
                'type' => 'VARCHAR',
                'constraint' => '255',
            ],


        ]);
        $this->forge->addKey('id', true);
        $this->forge->createTable('tbl_setup');
    }

    public function down()
    {
        $this->forge->dropTable('tbl_setup', true);
    }
}
