Derek Jones | 4b9c629 | 2011-07-01 17:40:48 -0500 | [diff] [blame] | 1 | <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 2 | /** |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 3 | * CodeIgniter |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 4 | * |
Greg Aker | 741de1c | 2010-11-10 14:52:57 -0600 | [diff] [blame] | 5 | * An open source application development framework for PHP 5.1.6 or newer |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 6 | * |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 7 | * NOTICE OF LICENSE |
| 8 | * |
| 9 | * Licensed under the Open Software License version 3.0 |
| 10 | * |
| 11 | * This source file is subject to the Open Software License (OSL 3.0) that is |
| 12 | * bundled with this package in the files license.txt / license.rst. It is |
| 13 | * also available through the world wide web at this URL: |
| 14 | * http://opensource.org/licenses/OSL-3.0 |
| 15 | * If you did not receive a copy of the license and are unable to obtain it |
| 16 | * through the world wide web, please send an email to |
| 17 | * licensing@ellislab.com so we can send you a copy immediately. |
| 18 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 19 | * @package CodeIgniter |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 20 | * @author EllisLab Dev Team |
| 21 | * @copyright Copyright (c) 2008 - 2011, EllisLab, Inc. (http://ellislab.com/) |
| 22 | * @license http://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 23 | * @link http://codeigniter.com |
| 24 | * @since Version 1.0 |
| 25 | * @filesource |
| 26 | */ |
| 27 | |
| 28 | // ------------------------------------------------------------------------ |
| 29 | |
| 30 | /** |
| 31 | * Database Utility Class |
| 32 | * |
| 33 | * @category Database |
Derek Jones | f4a4bd8 | 2011-10-20 12:18:42 -0500 | [diff] [blame] | 34 | * @author EllisLab Dev Team |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 35 | * @link http://codeigniter.com/user_guide/database/ |
| 36 | */ |
| 37 | class CI_DB_forge { |
| 38 | |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 39 | var $fields = array(); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 40 | var $keys = array(); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 41 | var $primary_keys = array(); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 42 | var $db_char_set = ''; |
| 43 | |
| 44 | /** |
| 45 | * Constructor |
| 46 | * |
| 47 | * Grabs the CI super object instance so we can access it. |
| 48 | * |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 49 | */ |
Timothy Warren | a2097a0 | 2011-10-10 10:10:46 -0400 | [diff] [blame] | 50 | function __construct() |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 51 | { |
| 52 | // Assign the main database object to $this->db |
| 53 | $CI =& get_instance(); |
| 54 | $this->db =& $CI->db; |
| 55 | log_message('debug', "Database Forge Class Initialized"); |
| 56 | } |
| 57 | |
| 58 | // -------------------------------------------------------------------- |
| 59 | |
| 60 | /** |
| 61 | * Create database |
| 62 | * |
| 63 | * @access public |
| 64 | * @param string the database name |
| 65 | * @return bool |
| 66 | */ |
| 67 | function create_database($db_name) |
| 68 | { |
| 69 | $sql = $this->_create_database($db_name); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 70 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 71 | if (is_bool($sql)) |
| 72 | { |
| 73 | return $sql; |
| 74 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 75 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 76 | return $this->db->query($sql); |
| 77 | } |
| 78 | |
| 79 | // -------------------------------------------------------------------- |
| 80 | |
| 81 | /** |
| 82 | * Drop database |
| 83 | * |
| 84 | * @access public |
| 85 | * @param string the database name |
| 86 | * @return bool |
| 87 | */ |
| 88 | function drop_database($db_name) |
| 89 | { |
| 90 | $sql = $this->_drop_database($db_name); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 91 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 92 | if (is_bool($sql)) |
| 93 | { |
| 94 | return $sql; |
| 95 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 96 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 97 | return $this->db->query($sql); |
| 98 | } |
| 99 | |
| 100 | // -------------------------------------------------------------------- |
| 101 | |
| 102 | /** |
| 103 | * Add Key |
| 104 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 105 | * @param string key |
| 106 | * @param string type |
Phil Sturgeon | a7de97e | 2011-12-31 18:41:08 +0000 | [diff] [blame^] | 107 | * @return object |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 108 | */ |
Phil Sturgeon | a7de97e | 2011-12-31 18:41:08 +0000 | [diff] [blame^] | 109 | public function add_key($key = '', $primary = FALSE) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 110 | { |
| 111 | if (is_array($key)) |
| 112 | { |
Pascal Kriete | c3a4a8d | 2011-02-14 13:40:08 -0500 | [diff] [blame] | 113 | foreach ($key as $one) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 114 | { |
| 115 | $this->add_key($one, $primary); |
| 116 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 117 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 118 | return; |
| 119 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 120 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 121 | if ($key == '') |
| 122 | { |
| 123 | show_error('Key information is required for that operation.'); |
| 124 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 125 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 126 | if ($primary === TRUE) |
| 127 | { |
| 128 | $this->primary_keys[] = $key; |
| 129 | } |
| 130 | else |
| 131 | { |
| 132 | $this->keys[] = $key; |
| 133 | } |
Phil Sturgeon | a7de97e | 2011-12-31 18:41:08 +0000 | [diff] [blame^] | 134 | |
| 135 | return $this; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 136 | } |
| 137 | |
| 138 | // -------------------------------------------------------------------- |
| 139 | |
| 140 | /** |
| 141 | * Add Field |
| 142 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 143 | * @param string collation |
Phil Sturgeon | a7de97e | 2011-12-31 18:41:08 +0000 | [diff] [blame^] | 144 | * @return object |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 145 | */ |
Phil Sturgeon | a7de97e | 2011-12-31 18:41:08 +0000 | [diff] [blame^] | 146 | public function add_field($field = '') |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 147 | { |
| 148 | if ($field == '') |
| 149 | { |
| 150 | show_error('Field information is required.'); |
| 151 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 152 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 153 | if (is_string($field)) |
| 154 | { |
| 155 | if ($field == 'id') |
| 156 | { |
| 157 | $this->add_field(array( |
Phil Sturgeon | a7de97e | 2011-12-31 18:41:08 +0000 | [diff] [blame^] | 158 | 'id' => array( |
| 159 | 'type' => 'INT', |
| 160 | 'constraint' => 9, |
| 161 | 'auto_increment' => TRUE |
| 162 | ) |
| 163 | )); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 164 | $this->add_key('id', TRUE); |
| 165 | } |
| 166 | else |
| 167 | { |
| 168 | if (strpos($field, ' ') === FALSE) |
| 169 | { |
| 170 | show_error('Field information is required for that operation.'); |
| 171 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 172 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 173 | $this->fields[] = $field; |
| 174 | } |
| 175 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 176 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 177 | if (is_array($field)) |
| 178 | { |
| 179 | $this->fields = array_merge($this->fields, $field); |
| 180 | } |
Phil Sturgeon | a7de97e | 2011-12-31 18:41:08 +0000 | [diff] [blame^] | 181 | |
| 182 | return $this; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 183 | } |
| 184 | |
| 185 | // -------------------------------------------------------------------- |
| 186 | |
| 187 | /** |
| 188 | * Create Table |
| 189 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 190 | * @param string the table name |
| 191 | * @return bool |
| 192 | */ |
Phil Sturgeon | a7de97e | 2011-12-31 18:41:08 +0000 | [diff] [blame^] | 193 | public function create_table($table = '', $if_not_exists = FALSE) |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 194 | { |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 195 | if ($table == '') |
| 196 | { |
| 197 | show_error('A table name is required for that operation.'); |
| 198 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 199 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 200 | if (count($this->fields) == 0) |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 201 | { |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 202 | show_error('Field information is required.'); |
| 203 | } |
| 204 | |
| 205 | $sql = $this->_create_table($this->db->dbprefix.$table, $this->fields, $this->primary_keys, $this->keys, $if_not_exists); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 206 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 207 | $this->_reset(); |
Tomasz T | b9ec402 | 2011-12-05 15:28:33 +0100 | [diff] [blame] | 208 | |
| 209 | if (is_bool($sql)) |
| 210 | { |
| 211 | return $sql; |
| 212 | } |
| 213 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 214 | return $this->db->query($sql); |
| 215 | } |
| 216 | |
| 217 | // -------------------------------------------------------------------- |
| 218 | |
| 219 | /** |
| 220 | * Drop Table |
| 221 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 222 | * @param string the table name |
| 223 | * @return bool |
| 224 | */ |
Phil Sturgeon | a7de97e | 2011-12-31 18:41:08 +0000 | [diff] [blame^] | 225 | public function drop_table($table_name) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 226 | { |
| 227 | $sql = $this->_drop_table($this->db->dbprefix.$table_name); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 228 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 229 | if (is_bool($sql)) |
| 230 | { |
| 231 | return $sql; |
| 232 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 233 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 234 | return $this->db->query($sql); |
| 235 | } |
| 236 | |
| 237 | // -------------------------------------------------------------------- |
| 238 | |
| 239 | /** |
| 240 | * Rename Table |
| 241 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 242 | * @param string the old table name |
| 243 | * @param string the new table name |
| 244 | * @return bool |
| 245 | */ |
Phil Sturgeon | a7de97e | 2011-12-31 18:41:08 +0000 | [diff] [blame^] | 246 | public function rename_table($table_name, $new_table_name) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 247 | { |
| 248 | if ($table_name == '' OR $new_table_name == '') |
| 249 | { |
| 250 | show_error('A table name is required for that operation.'); |
| 251 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 252 | |
Zac Wasielewski | 0acf65a | 2011-07-15 22:23:18 -0400 | [diff] [blame] | 253 | $sql = $this->_rename_table($this->db->dbprefix.$table_name, $this->db->dbprefix.$new_table_name); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 254 | return $this->db->query($sql); |
| 255 | } |
| 256 | |
| 257 | // -------------------------------------------------------------------- |
| 258 | |
| 259 | /** |
| 260 | * Column Add |
| 261 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 262 | * @param string the table name |
| 263 | * @param string the column name |
| 264 | * @param string the column definition |
| 265 | * @return bool |
| 266 | */ |
Phil Sturgeon | a7de97e | 2011-12-31 18:41:08 +0000 | [diff] [blame^] | 267 | public function add_column($table = '', $field = array(), $after_field = '') |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 268 | { |
| 269 | if ($table == '') |
| 270 | { |
| 271 | show_error('A table name is required for that operation.'); |
| 272 | } |
| 273 | |
| 274 | // add field info into field array, but we can only do one at a time |
Robin Sowell | 8a54ef2 | 2009-03-04 14:49:53 +0000 | [diff] [blame] | 275 | // so we cycle through |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 276 | |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 277 | foreach ($field as $k => $v) |
| 278 | { |
| 279 | $this->add_field(array($k => $field[$k])); |
Robin Sowell | 8a54ef2 | 2009-03-04 14:49:53 +0000 | [diff] [blame] | 280 | |
| 281 | if (count($this->fields) == 0) |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 282 | { |
Robin Sowell | 8a54ef2 | 2009-03-04 14:49:53 +0000 | [diff] [blame] | 283 | show_error('Field information is required.'); |
| 284 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 285 | |
Robin Sowell | 8a54ef2 | 2009-03-04 14:49:53 +0000 | [diff] [blame] | 286 | $sql = $this->_alter_table('ADD', $this->db->dbprefix.$table, $this->fields, $after_field); |
| 287 | |
| 288 | $this->_reset(); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 289 | |
Robin Sowell | 8a54ef2 | 2009-03-04 14:49:53 +0000 | [diff] [blame] | 290 | if ($this->db->query($sql) === FALSE) |
| 291 | { |
| 292 | return FALSE; |
| 293 | } |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 294 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 295 | |
Robin Sowell | 8a54ef2 | 2009-03-04 14:49:53 +0000 | [diff] [blame] | 296 | return TRUE; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 297 | } |
| 298 | |
| 299 | // -------------------------------------------------------------------- |
| 300 | |
| 301 | /** |
| 302 | * Column Drop |
| 303 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 304 | * @param string the table name |
| 305 | * @param string the column name |
| 306 | * @return bool |
| 307 | */ |
Phil Sturgeon | a7de97e | 2011-12-31 18:41:08 +0000 | [diff] [blame^] | 308 | public function drop_column($table = '', $column_name = '') |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 309 | { |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 310 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 311 | if ($table == '') |
| 312 | { |
| 313 | show_error('A table name is required for that operation.'); |
| 314 | } |
| 315 | |
| 316 | if ($column_name == '') |
| 317 | { |
| 318 | show_error('A column name is required for that operation.'); |
| 319 | } |
| 320 | |
| 321 | $sql = $this->_alter_table('DROP', $this->db->dbprefix.$table, $column_name); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 322 | |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 323 | return $this->db->query($sql); |
| 324 | } |
| 325 | |
| 326 | // -------------------------------------------------------------------- |
| 327 | |
| 328 | /** |
| 329 | * Column Modify |
| 330 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 331 | * @param string the table name |
| 332 | * @param string the column name |
| 333 | * @param string the column definition |
| 334 | * @return bool |
| 335 | */ |
Phil Sturgeon | a7de97e | 2011-12-31 18:41:08 +0000 | [diff] [blame^] | 336 | public function modify_column($table = '', $field = array()) |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 337 | { |
| 338 | if ($table == '') |
| 339 | { |
| 340 | show_error('A table name is required for that operation.'); |
| 341 | } |
| 342 | |
| 343 | // add field info into field array, but we can only do one at a time |
Robin Sowell | 8a54ef2 | 2009-03-04 14:49:53 +0000 | [diff] [blame] | 344 | // so we cycle through |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 345 | |
Robin Sowell | 8a54ef2 | 2009-03-04 14:49:53 +0000 | [diff] [blame] | 346 | foreach ($field as $k => $v) |
| 347 | { |
Phil Sturgeon | a58ecae | 2010-12-15 10:32:10 +0000 | [diff] [blame] | 348 | // If no name provided, use the current name |
| 349 | if ( ! isset($field[$k]['name'])) |
| 350 | { |
| 351 | $field[$k]['name'] = $k; |
| 352 | } |
| 353 | |
Robin Sowell | 8a54ef2 | 2009-03-04 14:49:53 +0000 | [diff] [blame] | 354 | $this->add_field(array($k => $field[$k])); |
| 355 | |
| 356 | if (count($this->fields) == 0) |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 357 | { |
Robin Sowell | 8a54ef2 | 2009-03-04 14:49:53 +0000 | [diff] [blame] | 358 | show_error('Field information is required.'); |
| 359 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 360 | |
Robin Sowell | 8a54ef2 | 2009-03-04 14:49:53 +0000 | [diff] [blame] | 361 | $sql = $this->_alter_table('CHANGE', $this->db->dbprefix.$table, $this->fields); |
| 362 | |
| 363 | $this->_reset(); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 364 | |
Robin Sowell | 8a54ef2 | 2009-03-04 14:49:53 +0000 | [diff] [blame] | 365 | if ($this->db->query($sql) === FALSE) |
| 366 | { |
| 367 | return FALSE; |
| 368 | } |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 369 | } |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 370 | |
Robin Sowell | 8a54ef2 | 2009-03-04 14:49:53 +0000 | [diff] [blame] | 371 | return TRUE; |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 372 | } |
| 373 | |
| 374 | // -------------------------------------------------------------------- |
| 375 | |
| 376 | /** |
| 377 | * Reset |
| 378 | * |
| 379 | * Resets table creation vars |
| 380 | * |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 381 | * @return void |
| 382 | */ |
Phil Sturgeon | a7de97e | 2011-12-31 18:41:08 +0000 | [diff] [blame^] | 383 | protected function _reset() |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 384 | { |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 385 | $this->fields = array(); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 386 | $this->keys = array(); |
Barry Mieny | dd67197 | 2010-10-04 16:33:58 +0200 | [diff] [blame] | 387 | $this->primary_keys = array(); |
Derek Allard | 2067d1a | 2008-11-13 22:59:24 +0000 | [diff] [blame] | 388 | } |
| 389 | |
| 390 | } |
| 391 | |
| 392 | /* End of file DB_forge.php */ |
Derek Jones | a3ffbbb | 2008-05-11 18:18:29 +0000 | [diff] [blame] | 393 | /* Location: ./system/database/DB_forge.php */ |