|
@@ -44,7 +44,7 @@ discard block |
|
|
block discarded – undo |
|
44
|
44
|
} |
|
45
|
45
|
|
|
46
|
46
|
private function tableExists($name) { |
|
47
|
|
- $result = $this->pdo->query('SELECT name FROM sqlite_master WHERE type="table" and name="'. $name.'"'); |
|
|
47
|
+ $result = $this->pdo->query('SELECT name FROM sqlite_master WHERE type="table" and name="' . $name . '"'); |
|
48
|
48
|
return count($result->fetchAll()) == 1; |
|
49
|
49
|
} |
|
50
|
50
|
|
|
@@ -64,14 +64,14 @@ discard block |
|
|
block discarded – undo |
|
64
|
64
|
$this->stmtCache->clearCache(); |
|
65
|
65
|
|
|
66
|
66
|
// Create temp table to create a new structure |
|
67
|
|
- $affix = '_'.substr(md5($table), 0, 6); |
|
|
67
|
+ $affix = '_' . substr(md5($table), 0, 6); |
|
68
|
68
|
$tempTable = $table . $affix; |
|
69
|
69
|
$this->createTable($tempTable, $primaryKey, $data); |
|
70
|
70
|
$this->alterColumns($tempTable, $primaryKey, $data); |
|
71
|
71
|
$this->copyTableData($table, $tempTable); |
|
72
|
72
|
|
|
73
|
|
- $this->pdo->query('DROP TABLE IF EXISTS ' . $table ); |
|
74
|
|
- $this->pdo->query('ALTER TABLE ' . $tempTable . ' RENAME TO '. $table ); |
|
|
73
|
+ $this->pdo->query('DROP TABLE IF EXISTS ' . $table); |
|
|
74
|
+ $this->pdo->query('ALTER TABLE ' . $tempTable . ' RENAME TO ' . $table); |
|
75
|
75
|
|
|
76
|
76
|
} |
|
77
|
77
|
|
Please login to merge, or discard this patch.