diff --git a/db/db.code.version.txt b/db/db.code.version.txt index 9870ccc..e702a30 100644 --- a/db/db.code.version.txt +++ b/db/db.code.version.txt @@ -1 +1 @@ -187 +188 diff --git a/db/db.update.188.php b/db/db.update.188.php new file mode 100644 index 0000000..f215380 --- /dev/null +++ b/db/db.update.188.php @@ -0,0 +1,24 @@ +0 ORDER BY year"); + while($r=mysql_fetch_object($q)) { + echo " Creating conference: $r->val $r->year\n"; + mysql_query("INSERT INTO conferences (`name`,`type`,`status`,`year`) VALUES ('".mysql_real_escape_string($r->val." ".$r->year)."', + 'sciencefair', + 'ended', + '$r->year')"); + } + //but wait, the current fairyear is still running + echo " Setting science fair conference for {$config['FAIRYEAR']} to running\n"; + mysql_query("UPDATE conferences SET status='running' WHERE year='{$config['FAIRYEAR']}'"); + + +} + +?> diff --git a/db/db.update.188.sql b/db/db.update.188.sql new file mode 100644 index 0000000..98e6082 --- /dev/null +++ b/db/db.update.188.sql @@ -0,0 +1,2 @@ +ALTER TABLE `conferences` ADD `year` INT NULL DEFAULT NULL COMMENT 'used for migration only, this field will be dropped!'; +