@@ -25,7 +25,7 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | try { |
| 27 | 27 | //Check if we can use this migration method: |
| 28 | - $version = (int)$this->connection->fetchColumn("SELECT keyValue AS version FROM `internal` WHERE `keyName` = 'dbVersion'"); |
|
| 28 | + $version = (int) $this->connection->fetchColumn("SELECT keyValue AS version FROM `internal` WHERE `keyName` = 'dbVersion'"); |
|
| 29 | 29 | $this->abortIf($version !== 26, "This database migration can only be used if the database version is 26! Install Part-DB 0.5.6 and update database there!"); |
| 30 | 30 | } catch (DBALException $ex) { |
| 31 | 31 | //when the table was not found, then you can not use this migration |
@@ -46,15 +46,15 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | /** Migrate the part locations for parts with known instock */ |
| 48 | 48 | $this->addSql( |
| 49 | - 'INSERT INTO part_lots (id_part, id_store_location, amount, instock_unknown, last_modified, datetime_added) ' . |
|
| 50 | - 'SELECT parts.id, parts.id_storelocation, parts.instock, 0, NOW(), NOW() FROM parts ' . |
|
| 49 | + 'INSERT INTO part_lots (id_part, id_store_location, amount, instock_unknown, last_modified, datetime_added) '. |
|
| 50 | + 'SELECT parts.id, parts.id_storelocation, parts.instock, 0, NOW(), NOW() FROM parts '. |
|
| 51 | 51 | 'WHERE parts.instock >= 0' |
| 52 | 52 | ); |
| 53 | 53 | |
| 54 | 54 | //Migrate part locations for parts with unknown instock |
| 55 | 55 | $this->addSql( |
| 56 | - 'INSERT INTO part_lots (id_part, id_store_location, amount, instock_unknown, last_modified, datetime_added) ' . |
|
| 57 | - 'SELECT parts.id, parts.id_storelocation, 0, 1, NOW(), NOW() FROM parts ' . |
|
| 56 | + 'INSERT INTO part_lots (id_part, id_store_location, amount, instock_unknown, last_modified, datetime_added) '. |
|
| 57 | + 'SELECT parts.id, parts.id_storelocation, 0, 1, NOW(), NOW() FROM parts '. |
|
| 58 | 58 | 'WHERE parts.instock = -2' |
| 59 | 59 | ); |
| 60 | 60 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | { |
| 23 | 23 | try { |
| 24 | 24 | //Check if we can use this migration method: |
| 25 | - $version = (int)$this->connection->fetchColumn("SELECT keyValue AS version FROM `internal` WHERE `keyName` = 'dbVersion'"); |
|
| 25 | + $version = (int) $this->connection->fetchColumn("SELECT keyValue AS version FROM `internal` WHERE `keyName` = 'dbVersion'"); |
|
| 26 | 26 | $this->skipIf(true, "Old Part-DB Database detected! Continue with upgrade..."); |
| 27 | 27 | } catch (DBALException $ex) { |
| 28 | 28 | //when the table was not found, we can proceed, because we have an empty DB! |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | $this->addSql('ALTER TABLE `groups` ADD CONSTRAINT FK_F06D3970727ACA70 FOREIGN KEY (parent_id) REFERENCES `groups` (id)'); |
| 81 | 81 | |
| 82 | 82 | //Create table for user logs: |
| 83 | - $sql = $updateSteps[] = "CREATE TABLE `log` ". |
|
| 83 | + $sql = $updateSteps[] = "CREATE TABLE `log` ". |
|
| 84 | 84 | "( `id` INT NOT NULL AUTO_INCREMENT , `datetime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP() ,". |
| 85 | 85 | " `id_user` INT NOT NULL ,". |
| 86 | 86 | " `level` TINYINT NOT NULL ,". |