-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
108 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
echo "Updating DB Structure<br>"; | ||
$pdo->exec(file_get_contents('v2.sql')); | ||
|
||
echo "updating exsisting versions"; | ||
$orphean = array(); | ||
foreach($pdo->query("SELECT * FROM version")->fetchAll(PDO::FETCH_ASSOC) as $v){ | ||
$found=false; | ||
if(str_contains($v["name"], "SOPRANO")){ | ||
$pdo->exec("UPDATE `version` SET `soprano` = '1' WHERE `id_version` = ". $v["id_version"]); | ||
$found=true; | ||
} | ||
if(str_contains($v["name"], "ALTO")){ | ||
$pdo->exec("UPDATE `version` SET `alto` = '1' WHERE `id_version` = ". $v["id_version"]); | ||
$found=true; | ||
} | ||
if(str_contains($v["name"], "TENOR")){ | ||
$pdo->exec("UPDATE `version` SET `tenor` = '1' WHERE `id_version` = ". $v["id_version"]); | ||
$found=true; | ||
} | ||
if(str_contains($v["name"], "BASSE")){ | ||
$pdo->exec("UPDATE `version` SET `basse` = '1' WHERE `id_version` = ". $v["id_version"]); | ||
$found=true; | ||
} | ||
if(str_contains($v["name"], "TUTTI")){ | ||
$pdo->exec("UPDATE `version` SET `tutti` = '1' WHERE `id_version` = ". $v["id_version"]); | ||
$found=true; | ||
} | ||
if(!$found){ | ||
$orphean[] = $v["id_version"]; | ||
} | ||
} | ||
echo "<br><br>id not assigned:<pre>"; | ||
print_r($orphean); | ||
echo "</pre>"; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
ALTER TABLE `version` | ||
ADD `soprano` tinyint unsigned NOT NULL DEFAULT '0', | ||
ADD `alto` tinyint unsigned NOT NULL DEFAULT '0' AFTER `soprano`, | ||
ADD `tenor` tinyint unsigned NOT NULL DEFAULT '0' AFTER `alto`, | ||
ADD `basse` tinyint unsigned NOT NULL DEFAULT '0' AFTER `tenor`, | ||
ADD `tutti` tinyint unsigned NOT NULL DEFAULT '0' AFTER `basse`; | ||
|
||
UPDATE `config` SET `value` = '2' WHERE `id_cfg` = '4'; |