Ejemplo n.º 1
0
def db_init(sql_queue):
    miner.db_init(sql_queue)

    for suffix in ['', '_temp']:
        sql_queue.put({
            'command':
            'create',
            'name':
            'device{}'.format(suffix),
            'column_def':
            COLUMN_EDEVS,
            'additional':
            'PRIMARY KEY(`time`, `ip`, `port`, `device_id`)',
        })
        sql_queue.put({
            'command':
            'create',
            'name':
            'module{}'.format(suffix),
            'column_def':
            COLUMN_ESTATS,
            'additional':
            'PRIMARY KEY(\
                `time`, `ip`, `port`, `device_id`, `module_id`\
            )',
        })
def db_init(sql_queue):
    miner.db_init(sql_queue)

    for suffix in ['', '_temp']:
        sql_queue.put({
            'command': 'create',
            'name': 'device{}'.format(suffix),
            'column_def': COLUMN_EDEVS,
            'additional': 'PRIMARY KEY(`time`, `ip`, `port`, `device_id`)',
        })
        sql_queue.put({
            'command': 'create',
            'name': 'module{}'.format(suffix),
            'column_def': COLUMN_ESTATS,
            'additional': 'PRIMARY KEY(\
                `time`, `ip`, `port`, `device_id`, `module_id`\
            )',
        })