@@ -257,14 +257,14 @@ discard block |
||
| 257 | 257 | $this->tableName); |
| 258 | 258 | |
| 259 | 259 | AuditDataLayer::createAuditTrigger($this->dataSchemaName, |
| 260 | - $this->auditSchemaName, |
|
| 261 | - $this->tableName, |
|
| 262 | - $triggerName, |
|
| 263 | - $action, |
|
| 264 | - $this->additionalAuditColumns, |
|
| 265 | - $this->dataTableColumnsDatabase, |
|
| 266 | - $skipVariable, |
|
| 267 | - $additionSql); |
|
| 260 | + $this->auditSchemaName, |
|
| 261 | + $this->tableName, |
|
| 262 | + $triggerName, |
|
| 263 | + $action, |
|
| 264 | + $this->additionalAuditColumns, |
|
| 265 | + $this->dataTableColumnsDatabase, |
|
| 266 | + $skipVariable, |
|
| 267 | + $additionSql); |
|
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | //-------------------------------------------------------------------------------------------------------------------- |
@@ -337,23 +337,23 @@ discard block |
||
| 337 | 337 | foreach ($newColumns->getColumns() as $column) |
| 338 | 338 | { |
| 339 | 339 | $this->io->logInfo('New column <dbo>%s.%s</dbo>', |
| 340 | - $this->tableName, |
|
| 341 | - $column->getName()); |
|
| 340 | + $this->tableName, |
|
| 341 | + $column->getName()); |
|
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | foreach ($obsoleteColumns->getColumns() as $column) |
| 345 | 345 | { |
| 346 | 346 | $this->io->logInfo('Obsolete column <dbo>%s.%s</dbo>', |
| 347 | - $this->tableName, |
|
| 348 | - $column->getName()); |
|
| 347 | + $this->tableName, |
|
| 348 | + $column->getName()); |
|
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | foreach ($alteredColumns->getColumns() as $column) |
| 352 | 352 | { |
| 353 | 353 | $this->io->logInfo('Type of <dbo>%s.%s</dbo> has been altered to <dbo>%s</dbo>', |
| 354 | - $this->tableName, |
|
| 355 | - $column->getName(), |
|
| 356 | - $column->getProperty('column_type')); |
|
| 354 | + $this->tableName, |
|
| 355 | + $column->getName(), |
|
| 356 | + $column->getProperty('column_type')); |
|
| 357 | 357 | } |
| 358 | 358 | } |
| 359 | 359 | |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | |
| 63 | 63 | $this->additionalAuditColumns = |
| 64 | 64 | AuditDataLayer::resolveCanonicalAdditionalAuditColumns($this->config['database']['audit_schema'], |
| 65 | - $this->config['audit_columns']); |
|
| 65 | + $this->config['audit_columns']); |
|
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | //-------------------------------------------------------------------------------------------------------------------- |
@@ -135,8 +135,8 @@ discard block |
||
| 135 | 135 | { |
| 136 | 136 | $this->io->writeln(sprintf('<info>Found new table %s</info>', $table['table_name'])); |
| 137 | 137 | $this->config['tables'][$table['table_name']] = ['audit' => null, |
| 138 | - 'alias' => null, |
|
| 139 | - 'skip' => null]; |
|
| 138 | + 'alias' => null, |
|
| 139 | + 'skip' => null]; |
|
| 140 | 140 | } |
| 141 | 141 | } |
| 142 | 142 | } |
@@ -152,12 +152,12 @@ discard block |
||
| 152 | 152 | if ($this->config['tables'][$table['table_name']]['audit']) |
| 153 | 153 | { |
| 154 | 154 | $currentTable = new AuditTable($this->io, |
| 155 | - $this->config['database']['data_schema'], |
|
| 156 | - $this->config['database']['audit_schema'], |
|
| 157 | - $table['table_name'], |
|
| 158 | - $this->additionalAuditColumns, |
|
| 159 | - $this->config['tables'][$table['table_name']]['alias'], |
|
| 160 | - $this->config['tables'][$table['table_name']]['skip']); |
|
| 155 | + $this->config['database']['data_schema'], |
|
| 156 | + $this->config['database']['audit_schema'], |
|
| 157 | + $table['table_name'], |
|
| 158 | + $this->additionalAuditColumns, |
|
| 159 | + $this->config['tables'][$table['table_name']]['alias'], |
|
| 160 | + $this->config['tables'][$table['table_name']]['skip']); |
|
| 161 | 161 | |
| 162 | 162 | // Ensure the audit table exists. |
| 163 | 163 | if (AuditDataLayer::searchInRowSet('table_name', $table['table_name'], $this->auditSchemaTables)===null) |
@@ -70,7 +70,7 @@ |
||
| 70 | 70 | |
| 71 | 71 | $this->additionalAuditColumns = |
| 72 | 72 | AuditDataLayer::resolveCanonicalAdditionalAuditColumns($this->config['database']['audit_schema'], |
| 73 | - $this->config['audit_columns']); |
|
| 73 | + $this->config['audit_columns']); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | //-------------------------------------------------------------------------------------------------------------------- |
@@ -123,7 +123,7 @@ |
||
| 123 | 123 | $dataTableColumns = TableColumnsMetadata::combine($this->additionalAuditColumns, $dataTableColumns); |
| 124 | 124 | |
| 125 | 125 | // In the audit table columns coming from the data table don't have defaults. |
| 126 | - foreach($auditTableColumns->getColumns() as $column) |
|
| 126 | + foreach ($auditTableColumns->getColumns() as $column) |
|
| 127 | 127 | { |
| 128 | 128 | if (!in_array($column->getName(), $this->additionalAuditColumns->getColumnNames())) |
| 129 | 129 | { |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | $this->additionalAuditColumns = |
| 50 | 50 | AuditDataLayer::resolveCanonicalAdditionalAuditColumns($this->config['database']['audit_schema'], |
| 51 | - $this->config['audit_columns']); |
|
| 51 | + $this->config['audit_columns']); |
|
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | //-------------------------------------------------------------------------------------------------------------------- |
@@ -103,8 +103,8 @@ discard block |
||
| 103 | 103 | $maxLength = $diff->getLongestColumnNameLength(); |
| 104 | 104 | |
| 105 | 105 | $this->codeStore->append(sprintf('alter table `%s`.`%s`', |
| 106 | - $this->config['database']['audit_schema'], |
|
| 107 | - $auditTable->getTableName())); |
|
| 106 | + $this->config['database']['audit_schema'], |
|
| 107 | + $auditTable->getTableName())); |
|
| 108 | 108 | |
| 109 | 109 | $first = true; |
| 110 | 110 | foreach ($diff->getColumns() as $column) |
@@ -115,11 +115,11 @@ discard block |
||
| 115 | 115 | if (!$first) $this->codeStore->appendToLastLine(','); |
| 116 | 116 | |
| 117 | 117 | $this->codeStore->append(sprintf('change column `%s`%s`%s`%s%s', |
| 118 | - $name, |
|
| 119 | - $filler, |
|
| 120 | - $name, |
|
| 121 | - $filler, |
|
| 122 | - $column->getColumnAuditDefinition())); |
|
| 118 | + $name, |
|
| 119 | + $filler, |
|
| 120 | + $name, |
|
| 121 | + $filler, |
|
| 122 | + $column->getColumnAuditDefinition())); |
|
| 123 | 123 | |
| 124 | 124 | $first = false; |
| 125 | 125 | } |
@@ -165,9 +165,9 @@ discard block |
||
| 165 | 165 | } |
| 166 | 166 | |
| 167 | 167 | $this->codeStore->append(sprintf('alter table `%s`.`%s` %s;', |
| 168 | - $this->config['database']['audit_schema'], |
|
| 169 | - $auditTable->getTableName(), |
|
| 170 | - implode(' ', $parts))); |
|
| 168 | + $this->config['database']['audit_schema'], |
|
| 169 | + $auditTable->getTableName(), |
|
| 170 | + implode(' ', $parts))); |
|
| 171 | 171 | $this->codeStore->append(''); |
| 172 | 172 | } |
| 173 | 173 | } |
@@ -82,14 +82,14 @@ discard block |
||
| 82 | 82 | $additionSql) |
| 83 | 83 | { |
| 84 | 84 | $helper = new CreateAuditTrigger($dataSchemaName, |
| 85 | - $auditSchemaName, |
|
| 86 | - $tableName, |
|
| 87 | - $triggerName, |
|
| 88 | - $triggerAction, |
|
| 89 | - $additionalAuditColumns, |
|
| 90 | - $tableColumns, |
|
| 91 | - $skipVariable, |
|
| 92 | - $additionSql); |
|
| 85 | + $auditSchemaName, |
|
| 86 | + $tableName, |
|
| 87 | + $triggerName, |
|
| 88 | + $triggerAction, |
|
| 89 | + $additionalAuditColumns, |
|
| 90 | + $tableColumns, |
|
| 91 | + $skipVariable, |
|
| 92 | + $additionSql); |
|
| 93 | 93 | $sql = $helper->buildStatement(); |
| 94 | 94 | |
| 95 | 95 | self::executeNone($sql); |
@@ -260,8 +260,8 @@ discard block |
||
| 260 | 260 | where TABLE_SCHEMA = %s |
| 261 | 261 | and TABLE_NAME = %s |
| 262 | 262 | order by ORDINAL_POSITION", |
| 263 | - static::quoteString($schemaName), |
|
| 264 | - static::quoteString($tableName)); |
|
| 263 | + static::quoteString($schemaName), |
|
| 264 | + static::quoteString($tableName)); |
|
| 265 | 265 | |
| 266 | 266 | return self::executeRows($sql); |
| 267 | 267 | } |
@@ -287,8 +287,8 @@ discard block |
||
| 287 | 287 | inner join information_schema.COLLATION_CHARACTER_SET_APPLICABILITY t2 on t2.COLLATION_NAME = t1.TABLE_COLLATION |
| 288 | 288 | WHERE t1.TABLE_SCHEMA = %s |
| 289 | 289 | AND t1.TABLE_NAME = %s', |
| 290 | - static::quoteString($schemaName), |
|
| 291 | - static::quoteString($tableName)); |
|
| 290 | + static::quoteString($schemaName), |
|
| 291 | + static::quoteString($tableName)); |
|
| 292 | 292 | |
| 293 | 293 | return self::executeRow1($sql); |
| 294 | 294 | } |
@@ -310,8 +310,8 @@ discard block |
||
| 310 | 310 | where TRIGGER_SCHEMA = %s |
| 311 | 311 | and EVENT_OBJECT_TABLE = %s |
| 312 | 312 | order by Trigger_Name', |
| 313 | - static::quoteString($schemaName), |
|
| 314 | - static::quoteString($tableName)); |
|
| 313 | + static::quoteString($schemaName), |
|
| 314 | + static::quoteString($tableName)); |
|
| 315 | 315 | |
| 316 | 316 | return self::executeRows($sql); |
| 317 | 317 | } |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | where TRIGGER_SCHEMA = %s |
| 354 | 354 | order by EVENT_OBJECT_TABLE |
| 355 | 355 | , TRIGGER_NAME', |
| 356 | - static::quoteString($schemaName)); |
|
| 356 | + static::quoteString($schemaName)); |
|
| 357 | 357 | |
| 358 | 358 | return self::executeRows($sql); |
| 359 | 359 | } |
@@ -229,20 +229,20 @@ discard block |
||
| 229 | 229 | if (in_array($column, $auditColumns)) |
| 230 | 230 | { |
| 231 | 231 | $this->rows[] = ['name' => $column, |
| 232 | - 'audit' => $this->auditTable->getColumns()->getColumn($column), |
|
| 233 | - 'data' => $this->dataTable->getColumns()->getColumn($column), |
|
| 234 | - 'type' => 'column', |
|
| 235 | - 'new' => false, |
|
| 236 | - 'obsolete' => false]; |
|
| 232 | + 'audit' => $this->auditTable->getColumns()->getColumn($column), |
|
| 233 | + 'data' => $this->dataTable->getColumns()->getColumn($column), |
|
| 234 | + 'type' => 'column', |
|
| 235 | + 'new' => false, |
|
| 236 | + 'obsolete' => false]; |
|
| 237 | 237 | } |
| 238 | 238 | else |
| 239 | 239 | { |
| 240 | 240 | $this->rows[] = ['name' => $column, |
| 241 | - 'audit' => null, |
|
| 242 | - 'data' => $this->dataTable->getColumns()->getColumn($column), |
|
| 243 | - 'type' => 'column', |
|
| 244 | - 'new' => true, |
|
| 245 | - 'obsolete' => false]; |
|
| 241 | + 'audit' => null, |
|
| 242 | + 'data' => $this->dataTable->getColumns()->getColumn($column), |
|
| 243 | + 'type' => 'column', |
|
| 244 | + 'new' => true, |
|
| 245 | + 'obsolete' => false]; |
|
| 246 | 246 | } |
| 247 | 247 | } |
| 248 | 248 | |
@@ -251,11 +251,11 @@ discard block |
||
| 251 | 251 | if (!in_array($column, $dataColumns)) |
| 252 | 252 | { |
| 253 | 253 | $this->rows[] = ['name' => $column, |
| 254 | - 'audit' => $this->auditTable->getColumns()->getColumn($column), |
|
| 255 | - 'data' => null, |
|
| 256 | - 'type' => 'column', |
|
| 257 | - 'new' => false, |
|
| 258 | - 'obsolete' => true]; |
|
| 254 | + 'audit' => $this->auditTable->getColumns()->getColumn($column), |
|
| 255 | + 'data' => null, |
|
| 256 | + 'type' => 'column', |
|
| 257 | + 'new' => false, |
|
| 258 | + 'obsolete' => true]; |
|
| 259 | 259 | } |
| 260 | 260 | } |
| 261 | 261 | } |
@@ -272,10 +272,10 @@ discard block |
||
| 272 | 272 | foreach ($dataOptions as $option) |
| 273 | 273 | { |
| 274 | 274 | $this->rows[] = ['name' => $option, |
| 275 | - 'audit1' => $this->auditTable->getProperty($option), |
|
| 276 | - 'data1' => $this->dataTable->getProperty($option), |
|
| 277 | - 'type' => 'option', |
|
| 278 | - 'rowspan' => 1]; |
|
| 275 | + 'audit1' => $this->auditTable->getProperty($option), |
|
| 276 | + 'data1' => $this->dataTable->getProperty($option), |
|
| 277 | + 'type' => 'option', |
|
| 278 | + 'rowspan' => 1]; |
|
| 279 | 279 | } |
| 280 | 280 | |
| 281 | 281 | foreach ($auditOptions as $option) |
@@ -283,10 +283,10 @@ discard block |
||
| 283 | 283 | if (!in_array($option, $dataOptions)) |
| 284 | 284 | { |
| 285 | 285 | $this->rows[] = ['name' => $option, |
| 286 | - 'audit1' => $this->auditTable->getProperty($option), |
|
| 287 | - 'data2' => null, |
|
| 288 | - 'type' => 'option', |
|
| 289 | - 'rowspan' => 1]; |
|
| 286 | + 'audit1' => $this->auditTable->getProperty($option), |
|
| 287 | + 'data2' => null, |
|
| 288 | + 'type' => 'option', |
|
| 289 | + 'rowspan' => 1]; |
|
| 290 | 290 | } |
| 291 | 291 | } |
| 292 | 292 | } |