Difference between revisions of "Jk-voting-force voting exist"

From AOLserver Wiki
Jump to navigation Jump to search
(imported from WiKit id 77)
 
m (Reverted edit of 71.192.182.191, changed back to last version by 70.160.102.101)
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
proc force_voting_exist {dbhandle} {  
+
proc force_voting_exist {dbhandle} { #postgres specific ns_log Notice
    #postgres specific
 
    ns_log Notice "Checking to see if table voting exists"
 
    if {[[ns_db 0or1row $dbhandle \
 
"select * from pg_tables where tablename = 'voting_topics'"]] == ""} {
 
        ns_db exec $dbhandle "create table voting_topics (\
 
                topic_identifier serial,\
 
                subject          text,\
 
                author          varchar(20)\
 
                );"
 
    }
 
    if {[[ns_db 0or1row $dbhandle "select * from pg_tables where tablename = 'voting_detail'"]] == ""} {
 
        ns_db exec $dbhandle "create table voting_detail (\
 
                option_identifier serial,\
 
                option          text,\
 
                author          varchar(20),\
 
                votes            integer,\
 
                voters          text,\
 
                topic_identifier integer\
 
                );"
 
    }
 
}
 

Latest revision as of 13:06, 24 March 2006

proc force_voting_exist {dbhandle} { #postgres specific ns_log Notice