create_table($table = ”, $columns = array ())
18: function create_table($table = '', $columns = array ()) {
19: $query = "create table `$table` ";
20: if (count($columns) > 0) {
21: foreach ($columns as $column => $option) {
22: $options .= "`$column` $option,";
23: }
24: }
25: if (isset ($columns['id'])) {
26: $options .= "PRIMARY KEY (`id`)";
27: }
28: $options = rtrim($options, ',');
29: $query .= "( $options )";
30: $this->RunQuery($query);
31: }
File: lib/model/Migrations.php, #line 18
drop_table($table = ”)
36: function drop_table($table = '') {
37: $query = "drop table if exists `$table`";
38: $this->RunQuery($query);
39: }
File: lib/model/Migrations.php, #line 36
rename_table($table = ”, $newTable = ”)
44: function rename_table($table = '', $newTable = '') {
45: $query = "alter table {$table} rename {$newTable}";
46: $this->RunQuery($query);
47: }
File: lib/model/Migrations.php, #line 44
add_column($table = ”, $column = ”, $options = ”)
52: function add_column($table = '', $column = '', $options = '') {
53: $query = "alter table $table add column $column $options";
54: $this->RunQuery($query);
55: }
File: lib/model/Migrations.php, #line 52
rename_column($table = ”, $column = ”,$newColumn = ”, $options = ”)
60: function rename_column($table = '', $column = '',$newColumn = '', $options = '') {
61: $query = "ALTER TABLE {$table} change {$column} {$newColumn} {$options}";
62: $this->RunQuery($query);
63: }
File: lib/model/Migrations.php, #line 60
change_column($table = ”, $column = ”, $options = ”)
68: function change_column($table = '', $column = '', $options = '') {
69: $query = "alter table {$table} modify column {$column} {$options}";
70: $this->RunQuery($query);
71: }
File: lib/model/Migrations.php, #line 68
remove_column($table = ”, $column = ”)
76: function remove_column($table = '', $column = '') {
77: $query = "alter table $table drop column $column";
78: $this->RunQuery($query);
79: }
File: lib/model/Migrations.php, #line 76
add_index($index = ”, $table = ”, $columns = ”)
84: function add_index($index = '', $table = '', $columns = '') {
85: $query = "create index {$index} ON {$table} ({$columns})";
86: $this->RunQuery($query);
87: }
File: lib/model/Migrations.php, #line 84
remove_index($index = ”)
92: function remove_index($index = '') {
93: $query = "drop index {$index}";
94: $this->RunQuery($query);
95: }
File: lib/model/Migrations.php, #line 92
