@@ -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! |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | */ |
86 | 86 | |
87 | 87 | //Create table for user logs: |
88 | - $sql = $updateSteps[] = "CREATE TABLE `log` ". |
|
88 | + $sql = $updateSteps[] = "CREATE TABLE `log` ". |
|
89 | 89 | "( `id` INT NOT NULL AUTO_INCREMENT , `datetime` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP() ,". |
90 | 90 | " `id_user` INT NOT NULL ,". |
91 | 91 | " `level` TINYINT NOT NULL ,". |
@@ -50,15 +50,15 @@ |
||
50 | 50 | |
51 | 51 | //Add a attachment for each footprint attachment |
52 | 52 | $this->addSql( |
53 | - 'INSERT IGNORE INTO attachments (element_id, type_id, name, class_name, path, last_modified, datetime_added) ' . |
|
54 | - "SELECT footprints.id, 1000, 'Footprint', 'Footprint', REPLACE(footprints.filename, '%BASE%/img/footprints', '%FOOTPRINTS%' ), NOW(), NOW() FROM footprints " . |
|
53 | + 'INSERT IGNORE INTO attachments (element_id, type_id, name, class_name, path, last_modified, datetime_added) '. |
|
54 | + "SELECT footprints.id, 1000, 'Footprint', 'Footprint', REPLACE(footprints.filename, '%BASE%/img/footprints', '%FOOTPRINTS%' ), NOW(), NOW() FROM footprints ". |
|
55 | 55 | "WHERE footprints.filename <> ''" |
56 | 56 | ); |
57 | 57 | |
58 | 58 | //Do the same for 3D Footprints |
59 | 59 | $this->addSql( |
60 | - 'INSERT IGNORE INTO attachments (element_id, type_id, name, class_name, path, last_modified, datetime_added) ' . |
|
61 | - "SELECT footprints.id, 1001, 'Footprint 3D', 'Footprint', REPLACE(footprints.filename_3d, '%BASE%/models', '%FOOTPRINTS3D%' ), NOW(), NOW() FROM footprints " . |
|
60 | + 'INSERT IGNORE INTO attachments (element_id, type_id, name, class_name, path, last_modified, datetime_added) '. |
|
61 | + "SELECT footprints.id, 1001, 'Footprint 3D', 'Footprint', REPLACE(footprints.filename_3d, '%BASE%/models', '%FOOTPRINTS3D%' ), NOW(), NOW() FROM footprints ". |
|
62 | 62 | "WHERE footprints.filename_3d <> ''" |
63 | 63 | ); |
64 | 64 |
@@ -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 IGNORE 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 IGNORE 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 IGNORE 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 IGNORE 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 |