Changeset View
Changeset View
Standalone View
Standalone View
resources/sql/autopatches/20140108.ddbpname.2.php
| <?php | <?php | ||||
| echo "Adding names to Drydock blueprints.\n"; | echo pht('Adding names to Drydock blueprints.')."\n"; | ||||
| $table = new DrydockBlueprint(); | $table = new DrydockBlueprint(); | ||||
| $conn_w = $table->establishConnection('w'); | $conn_w = $table->establishConnection('w'); | ||||
| $iterator = new LiskMigrationIterator($table); | $iterator = new LiskMigrationIterator($table); | ||||
| foreach ($iterator as $blueprint) { | foreach ($iterator as $blueprint) { | ||||
| $id = $blueprint->getID(); | $id = $blueprint->getID(); | ||||
| echo "Populating blueprint {$id}...\n"; | echo pht('Populating blueprint %d...', $id)."\n"; | ||||
| if (!strlen($blueprint->getBlueprintName())) { | if (!strlen($blueprint->getBlueprintName())) { | ||||
| queryfx( | queryfx( | ||||
| $conn_w, | $conn_w, | ||||
| 'UPDATE %T SET blueprintName = %s WHERE id = %d', | 'UPDATE %T SET blueprintName = %s WHERE id = %d', | ||||
| $table->getTableName(), | $table->getTableName(), | ||||
| pht('Blueprint %s', $id), | pht('Blueprint %s', $id), | ||||
| $id); | $id); | ||||
| } | } | ||||
| } | } | ||||
| echo "Done.\n"; | echo pht('Done.')."\n"; | ||||