#NEWLINE# def create_tables( self ) : #NEWLINE# #INDENT# 'Creates the tables required for the handler on the class and\n        metadata.\n        ' #NEWLINE# import sqlalchemy as db #NEWLINE# def table( name , * args , **kwargs ) : #NEWLINE# #INDENT# return db . Table ( ( self . table_prefix + name ) , self . metadata , * args , ** kwargs ) #NEWLINE# #UNINDENT# self . tickets = table ( 'tickets' , db . Column ( 'ticket_id' , db . Integer , primary_key = True ) , db . Column ( 'record_hash' , db . String ( 40 ) , unique = True ) , db . Column ( 'level' , db . Integer ) , db . Column ( 'channel' , db . String ( 120 ) ) , db . Column ( 'location' , db . String ( 512 ) ) , db . Column ( 'module' , db . String ( 256 ) ) , db . Column ( 'last_occurrence_time' , db . DateTime ) , db . Column ( 'occurrence_count' , db . Integer ) , db . Column ( 'solved' , db . Boolean ) , db . Column ( 'app_id' , db . String ( 80 ) ) ) #NEWLINE# self . occurrences = table ( 'occurrences' , db . Column ( 'occurrence_id' , db . Integer , primary_key = True ) , db . Column ( 'ticket_id' , db . Integer , db . ForeignKey ( ( self . table_prefix + 'tickets.ticket_id' ) ) ) , db . Column ( 'time' , db . DateTime ) , db . Column ( 'data' , db . Text ) , db . Column ( 'app_id' , db . String ( 80 ) ) )