aboutsummaryrefslogtreecommitdiff
path: root/UpdateAccessRights.tcl
blob: db28609d7906ab72ba55a97811f8b3b119410b2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
# (C) 2011 by Eugeniy Mikhailov, <evgmik@gmail.com>
# vim:set ft=tcl: \
exec tclsh "$0" "$@"


# delete and recreate AccessRightsTable 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 eval_str [concat DROP TABLE AccessRightsTable]
	set err [catch {db eval $eval_str } errStat]
	if { $err } {
		dbg $errStat msg_level_critical
	}

CreateAccessRightsTable db


# vim: ts=2 sw=2 foldmethod=indent: