Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php namespace App\Database\Migrations;
- use CodeIgniter\Database\Migration;
- class Candidates extends Migration
- {
- public function up()
- {
- $this->forge->addField([
- 'id' => [
- 'type' => 'INT',
- 'unsigned' => true,
- 'auto_increment' => true,
- ],
- 'name' => [
- 'type' => 'VARCHAR',
- 'constraint' => '75',
- 'null' => true,
- ],
- 'number' => [
- 'type' => 'VARCHAR',
- 'constraint' => '3',
- 'null' => true,
- ],
- 'amount' => [
- 'type' => 'INT',
- 'unsigned' => true,
- 'null' => true,
- ],
- 'vision' => [
- 'type' => 'VARCHAR',
- 'constraint' => '255',
- 'null' => true,
- ],
- 'mission' => [
- 'type' => 'VARCHAR',
- 'constraint' => '255',
- 'null' => true,
- ],
- 'username' => [
- 'type' => 'VARCHAR',
- 'constraint' => '25',
- 'null' => true,
- ],
- 'password' => [
- 'type' => 'VARCHAR',
- 'constraint' => '65',
- 'null' => true,
- ],
- 'active' => [
- 'type' => 'ENUM',
- 'constraint' => ['Y', 'N'],
- 'default' => 'N',
- ],
- 'photo' => [
- 'type' => 'VARCHAR',
- 'constraint' => '100',
- 'null' => true,
- ],
- ]);
- $this->forge->addKey('id', true);
- $this->forge->createTable('candidates');
- }
- //--------------------------------------------------------------------
- public function down()
- {
- $this->forge->dropTable('candidates');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement