import os
import sys

sys.path.append(os.path.dirname(os.path.realpath(__file__))+'/../..')

from malware_data_science.config import Config
from malware_data_science.db import DB, AttributeType

db = DB()
attribute_types = [
  'Domain',
  'Email address',
  'Email',
  'Filename written in disk',
  'MD5 hash of file written in disk',
  'SHA1 hash file written in disk',
  'SHA256 hash of file written in disk',
  'SSDEEP hash of file written in disk',
  'IP address',
  'Mutex',
  'Process',
  'Registry',
  'URL',
  'Threat name'
]

for name in attribute_types:
  if AttributeType.one_by_name(name):
    continue
  attribute_type = AttributeType()
  attribute_type.name = name
  db.session.add(attribute_type)
db.session.commit()