From 114ab0988e20ac6be39ad363ff897a1a3b85e565 Mon Sep 17 00:00:00 2001
From: Razican
After the fields have been defined, they can be added using $this->dbforge->add_field($fields); followed by a call to the create_table() function.
+After the fields have been defined, they can be added using $this->dbforge->add_field($fields); followed by a call to the create_table() function.
The add fields function will accept the above array.
Generally speaking, you'll want your table to have Keys. This is accomplished with $this->dbforge->add_key('field'). An optional second parameter set to TRUE will make it a primary key. Note that add_key() must be followed by a call to create_table().
-Multiple column non-primary keys must be sent as an array. Sample output below is for MySQL.
+Multiple column non-primary keys must be sent as an array. Sample output below is for MySQL.
$this->dbforge->add_key('blog_id', TRUE);
// gives PRIMARY KEY `blog_id` (`blog_id`)
@@ -187,7 +187,7 @@ already be running, since the forge class relies on it.
Executes a DROP TABLE sql
$this->dbforge->drop_table('table_name');
- // gives DROP TABLE IF EXISTS table_name
Executes a TABLE rename
$this->dbforge->rename_table('old_table_name', 'new_table_name');
@@ -200,7 +200,7 @@ already be running, since the forge class relies on it.
Used to remove a column from a table.
$this->dbforge->drop_column('table_name', 'column_to_drop');
-- cgit v1.2.3-24-g4f1b From 4b9c62980599228f070b401c7673dce8085b0c61 Mon Sep 17 00:00:00 2001 From: Derek Jones
After the fields have been defined, they can be added using $this->dbforge->add_field($fields); followed by a call to the create_table() function.
+After the fields have been defined, they can be added using $this->dbforge->add_field($fields); followed by a call to the create_table() function.
The add fields function will accept the above array.
Generally speaking, you'll want your table to have Keys. This is accomplished with $this->dbforge->add_key('field'). An optional second parameter set to TRUE will make it a primary key. Note that add_key() must be followed by a call to create_table().
-Multiple column non-primary keys must be sent as an array. Sample output below is for MySQL.
+Multiple column non-primary keys must be sent as an array. Sample output below is for MySQL.
$this->dbforge->add_key('blog_id', TRUE);
// gives PRIMARY KEY `blog_id` (`blog_id`)
@@ -187,7 +187,7 @@ already be running, since the forge class relies on it.
Executes a DROP TABLE sql
$this->dbforge->drop_table('table_name');
- // gives DROP TABLE IF EXISTS table_name
Executes a TABLE rename
$this->dbforge->rename_table('old_table_name', 'new_table_name');
@@ -200,7 +200,7 @@ already be running, since the forge class relies on it.
Used to remove a column from a table.
$this->dbforge->drop_column('table_name', 'column_to_drop');
-- cgit v1.2.3-24-g4f1b