Subversion-Projekte lars-tiefland.ci

Revision

Revision 68 | Revision 2107 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 68 Revision 2049
Zeile 4... Zeile 4...
4
 *
4
 *
5
 * An open source application development framework for PHP
5
 * An open source application development framework for PHP
6
 *
6
 *
7
 * This content is released under the MIT License (MIT)
7
 * This content is released under the MIT License (MIT)
8
 *
8
 *
9
 * Copyright (c) 2014 - 2016, British Columbia Institute of Technology
9
 * Copyright (c) 2014 - 2017, British Columbia Institute of Technology
10
 *
10
 *
11
 * Permission is hereby granted, free of charge, to any person obtaining a copy
11
 * Permission is hereby granted, free of charge, to any person obtaining a copy
12
 * of this software and associated documentation files (the "Software"), to deal
12
 * of this software and associated documentation files (the "Software"), to deal
13
 * in the Software without restriction, including without limitation the rights
13
 * in the Software without restriction, including without limitation the rights
14
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
Zeile 27... Zeile 27...
27
 * THE SOFTWARE.
27
 * THE SOFTWARE.
28
 *
28
 *
29
 * @package	CodeIgniter
29
 * @package	CodeIgniter
30
 * @author	EllisLab Dev Team
30
 * @author	EllisLab Dev Team
31
 * @copyright	Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
31
 * @copyright	Copyright (c) 2008 - 2014, EllisLab, Inc. (https://ellislab.com/)
32
 * @copyright	Copyright (c) 2014 - 2016, British Columbia Institute of Technology (http://bcit.ca/)
32
 * @copyright	Copyright (c) 2014 - 2017, British Columbia Institute of Technology (http://bcit.ca/)
33
 * @license	http://opensource.org/licenses/MIT	MIT License
33
 * @license	http://opensource.org/licenses/MIT	MIT License
34
 * @link	https://codeigniter.com
34
 * @link	https://codeigniter.com
35
 * @since	Version 1.4.1
35
 * @since	Version 1.4.1
36
 * @filesource
36
 * @filesource
37
 */
37
 */
Zeile 124... Zeile 124...
124
				if ($alter_type === 'MODIFY' && ! empty($field[$i]['new_name']))
124
				if ($alter_type === 'MODIFY' && ! empty($field[$i]['new_name']))
125
				{
125
				{
126
					$sqls[] = $sql.' RENAME COLUMN '.$this->db->escape_identifiers($field[$i]['name'])
126
					$sqls[] = $sql.' RENAME COLUMN '.$this->db->escape_identifiers($field[$i]['name'])
127
						.' '.$this->db->escape_identifiers($field[$i]['new_name']);
127
						.' '.$this->db->escape_identifiers($field[$i]['new_name']);
128
				}
128
				}
-
 
129
 
-
 
130
				$field[$i] = "\n\t".$field[$i]['_literal'];
129
			}
131
			}
130
		}
132
		}
Zeile 131... Zeile 133...
131
 
133
 
132
		$sql .= ' '.$alter_type.' ';
134
		$sql .= ' '.$alter_type.' ';
133
		$sql .= (count($field) === 1)
135
		$sql .= (count($field) === 1)
134
				? $field[0]
136
				? $field[0]
Zeile 135... Zeile 137...
135
				: '('.implode(',', $field).')';
137
				: '('.implode(',', $field).')';
136
 
138
 
137
		// RENAME COLUMN must be executed after MODIFY
139
		// RENAME COLUMN must be executed after MODIFY
138
		array_unshift($sqls, $sql);
140
		array_unshift($sqls, $sql);
Zeile 139... Zeile 141...
139
		return $sql;
141
		return $sqls;
Zeile 140... Zeile 142...
140
	}
142
	}