Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- defined('BASEPATH') OR exit('Forbidden');
- /**
- * Class Migration_create_users_table
- * @property CI_DB_forge $Forge
- */
- class Migration_create_users_table extends CI_Migration
- {
- public function up()
- {
- $this->Forge
- ->add_field([
- [
- 'username' => [
- 'type' => 'VARCHAR',
- 'constraint' => 30
- ],
- 'password' => [
- 'type' => 'VARCHAR',
- 'constraint' => 255
- ],
- 'active' => [
- 'type' => 'BOOLEAN',
- 'default' => 0
- ]
- ]
- ])
- ->add_key('id');
- $this->Forge
- ->create_table('table', true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment