aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xUpdateGradesTable.tcl31
1 files changed, 31 insertions, 0 deletions
diff --git a/UpdateGradesTable.tcl b/UpdateGradesTable.tcl
new file mode 100755
index 0000000..d577406
--- /dev/null
+++ b/UpdateGradesTable.tcl
@@ -0,0 +1,31 @@
+#!/bin/sh
+# (C) 2011 by Eugeniy Mikhailov, <evgmik@gmail.com>
+# vim:set ft=tcl: \
+exec tclsh "$0" "$@"
+
+
+# insert into GradesTable missing crucial columns according to the latest specification
+package require sqlite3
+package require md5
+source ./GradeBook_lib.tcl
+
+if { $argc < 1 } {
+ puts {Usage:}
+ puts "$argv0 database_name"
+ exit
+}
+
+set dbfile [lindex $argv 0]
+puts $dbfile
+
+sqlite3 db $dbfile
+
+set present_columns [getColListFromTable GradesTable]
+foreach {col sqltype} [GetDefaultGradesTableColumn] {
+ if { $col ni $present_columns } {
+ AddColumnNonWeb $col {} {} $sqltype
+ }
+}
+
+
+# vim: ts=2 sw=2 foldmethod=indent: