# encoding: utf-8

import MySQLdb

def main():
    username = raw_input('input username:')
    password = raw_input('input password:')

    db = MySQLdb.connect("localhost", username, password, 'nova')

    cursor = db.cursor()
 #   cursor.execute('drop table if exists tfilter')
    tfilter_sql = '''create table tfilter(
                                        id int not null,
                                        created_at datetime,
                                        updated_at datetime
                                        deleted_at datetime,
                                        deleted varchar(36),
                                        classid int,
                                        handle int,
                                        ip varchar(25),
                                        flowid varchar(10),
                                        prio int )'''
    
    cursor.execute(tfilter_sql)
    
 #   cursor.execute('drop table if exists tqdisc')
    
    tqdisc_sql = '''create table tqdisc(
                                          id int not null,
                                          created_at datetime,
                                          updated_at datetime
                                          deleted_at datetime,
                                          deleted varchar(36),
                                          instanceid varchar(50),
                                          classid varchar(20),
                                          ip varchar(25),
                                          host varchar(20),
                                          band int,
                                          prio int)'''
    
    cursor.execute(tqdisc_sql)
    
    db.commit()

    db.close()


if __name__ == '__main__':
    main()
@@ -438,32 +438,45 @@
 ated_at datetime
+ default null
 ,%0D%0A             
@@ -513,32 +513,46 @@
 ated_at datetime
+ default null,
 %0D%0A              
@@ -588,32 +588,45 @@
 eted_at datetime
+ default null
 ,%0D%0A             
@@ -1212,32 +1212,45 @@
 ated_at datetime
+ default null
 ,%0D%0A             
@@ -1297,16 +1297,30 @@
 datetime
+ default null,
 %0D%0A      
@@ -1374,16 +1374,29 @@
 datetime
+ default null
 ,%0D%0A     

modify the database