science-ation/db/db.update.209.php
james 4f42407073 migrate categories/divisions/subdivisions from FAIRYEAR to conferences_id
rename API call /config to /config/variables
update API with /config members for divisions/subdivisions/categories
2010-10-05 19:43:30 +00:00

22 lines
540 B
PHP

<?
function db_update_209_pre()
{
}
function db_update_209_post()
{
// get the year => conference_id links
$q1 = mysql_query("SELECT year, id FROM conferences WHERE year>0");
$tables=array("projectdivisions","projectsubdivisions","projectcategories","projectcategoriesdivisions_link");
//update the tables
while($r = mysql_fetch_assoc($q1)){
foreach($tables as $tableName){
$query = "UPDATE `$tableName` SET `conferences_id` = {$r['id']} WHERE `year` = {$r['year']}";
mysql_query($query);
echo $query . ";\n";
}
}
?>