summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2011-03-09 00:01:36 -0500
committerEugeniy Mikhailov <evgmik@gmail.com>2011-03-09 00:01:36 -0500
commit50e9e511e88b154af4e97feb7b59a37ac3b8fcc7 (patch)
tree8b4d3f64fe9c78455715be43d8cb09a8dc533da3
parentbf5818c9ab0bf12db73fe40fd90be18debf059cb (diff)
downloadGradeBook-50e9e511e88b154af4e97feb7b59a37ac3b8fcc7.tar.gz
GradeBook-50e9e511e88b154af4e97feb7b59a37ac3b8fcc7.zip
added file for updating AccessRightsTable
Ignore-this: 570909ba3c63564e7497ee6e6ed6385 darcs-hash:20110309050136-067c0-224db71466f42eba74b8f233a5e430f2801c70d9.gz
-rwxr-xr-xUpdateAccessRights.tcl32
1 files changed, 32 insertions, 0 deletions
diff --git a/UpdateAccessRights.tcl b/UpdateAccessRights.tcl
new file mode 100755
index 0000000..ce8d85f
--- /dev/null
+++ b/UpdateAccessRights.tcl
@@ -0,0 +1,32 @@
+#!/bin/sh
+# (C) 2011 by Eugeniy Mikhailov, <evgmik@gmail.com>
+# vim:set ft=tcl: \
+exec tclsh "$0" "$@"
+
+
+# delete and recreate AccessRightsTable according to 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 eval_str [concat DROP TABLE AccessRightsTable]
+ set err [catch {db eval $eval_str } errStat]
+ if { $err } {
+ dbg $errStat 3
+ }
+
+CreateAccessRightsTable db
+
+
+# vim: ts=2 sw=2 foldmethod=indent: