Skip to content

Commit 20e2291

Browse files
committed
Add sample code
1 parent 6edb9ec commit 20e2291

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

src/Command/Generate/templates/Migration.txt

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ class Migration_@@classname@@ extends CI_Migration {
99

1010
public function up()
1111
{
12+
// // Creating a table
1213
// $this->dbforge->add_field(array(
1314
// 'blog_id' => array(
1415
// 'type' => 'INT',
@@ -19,18 +20,33 @@ class Migration_@@classname@@ extends CI_Migration {
1920
// 'type' => 'VARCHAR',
2021
// 'constraint' => 100,
2122
// ),
23+
// 'blog_author' => array(
24+
// 'type' =>'VARCHAR',
25+
// 'constraint' => '100',
26+
// 'default' => 'King of Town',
27+
// ),
2228
// 'blog_description' => array(
2329
// 'type' => 'TEXT',
2430
// 'null' => TRUE,
2531
// ),
2632
// ));
2733
// $this->dbforge->add_key('blog_id', TRUE);
2834
// $this->dbforge->create_table('blog');
35+
36+
// // Adding a Column to a Table
37+
// $fields = array(
38+
// 'preferences' => array('type' => 'TEXT')
39+
// );
40+
// $this->dbforge->add_column('table_name', $fields);
2941
}
3042

3143
public function down()
3244
{
45+
// // Dropping a table
3346
// $this->dbforge->drop_table('blog');
47+
48+
// // Dropping a Column From a Table
49+
// $this->dbforge->drop_column('table_name', 'column_to_drop');
3450
}
3551

3652
}

0 commit comments

Comments
 (0)