diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-03-09 00:31:12 -0500 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2011-03-09 00:31:12 -0500 |
commit | 8426cebb643b8b5ffbe4de2f7f9fead00b65496f (patch) | |
tree | 49380e11ae050dd8996bc44cc3736f51a0580b68 /UpdateGradesTable.tcl | |
parent | 50e9e511e88b154af4e97feb7b59a37ac3b8fcc7 (diff) | |
download | GradeBook-8426cebb643b8b5ffbe4de2f7f9fead00b65496f.tar.gz GradeBook-8426cebb643b8b5ffbe4de2f7f9fead00b65496f.zip |
added script to update crucial columns according to the latest db specification
Ignore-this: 91f2c322ff12d7a050ebf57dcbafc224
darcs-hash:20110309053112-067c0-b5fe68b09c4b3817290b9e5222849a77dc0883fb.gz
Diffstat (limited to 'UpdateGradesTable.tcl')
-rwxr-xr-x | UpdateGradesTable.tcl | 31 |
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: |