Completed
Push — develop ( b91ef9...a714e6 )
by Kenji
02:25
created

Migration_Create_captcha::up()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 23
Code Lines 17

Duplication

Lines 0
Ratio 0 %
Metric Value
dl 0
loc 23
rs 9.0857
cc 1
eloc 17
nc 1
nop 0
1
<?php
2
/**
3
 * Migration: Create_captcha
4
 *
5
 * Created by: Cli for CodeIgniter <https://github.com/kenjis/codeigniter-cli>
6
 * Created on: 2015/05/12 06:00:32
7
 */
8
class Migration_Create_captcha extends CI_Migration {
9
10
	public function up()
11
	{
12
		$this->dbforge->add_field(array(
13
			'captcha_id' => array(
14
				'type' => 'BIGINT',
15
				'constraint' => 13,
16
				'unsigned' => TRUE,
17
				'auto_increment' => TRUE
18
			),
19
			'captcha_time' => array(
20
				'type' => 'INT',
21
				'constraint' => 10,
22
				'unsigned' => TRUE,
23
			),
24
			'word' => array(
25
				'type' => 'VARCHAR',
26
				'constraint' => '20',
27
			),
28
		));
29
		$this->dbforge->add_key('captcha_id', TRUE);
30
		$this->dbforge->add_key('word');
31
		$this->dbforge->create_table('captcha');
32
	}
33
34
	public function down()
35
	{
36
		$this->dbforge->drop_table('captcha');
37
	}
38
39
}
40