GRANT ALL PRIVILEGES ON *.* TO ''@localhost;
FLUSH PRIVILEGES;
CREATE DATABASE tango;
USE tango;
#
# Table structure for table 'attribute_class'
#
DROP TABLE IF EXISTS attribute_class;
CREATE TABLE attribute_class (
  class varchar(255) DEFAULT '' NOT NULL,
  name varchar(255) DEFAULT '' NOT NULL,
  updated timestamp(14),
  accessed timestamp(14),
  comment text,
  KEY index_attribute_class (class(64),name(64))
);

#
# Table structure for table 'device'
#
DROP TABLE IF EXISTS device;
CREATE TABLE device (
  name varchar(255),
  alias varchar(255),
  domain varchar(85),
  family varchar(85),
  member varchar(85),
  exported int(11),
  ior text,
  host varchar(255),
  server varchar(255),
  pid int(11),
  class varchar(255),
  version varchar(8),
  started datetime,
  stopped datetime,
  comment text
);

#
# Table structure for table 'property'
#
DROP TABLE IF EXISTS property;
CREATE TABLE property (
  object varchar(255),
  name varchar(255),
  count int(11),
  value varchar(255),
  updated timestamp(14),
  accessed timestamp(14),
  comment text
);

#
# Table structure for table 'property_attribute_class'
#
DROP TABLE IF EXISTS property_attribute_class;
CREATE TABLE property_attribute_class (
  class varchar(255) DEFAULT '' NOT NULL,
  attribute varchar(255) DEFAULT '' NOT NULL,
  name varchar(255) DEFAULT '' NOT NULL,
  count int(11) DEFAULT '0' NOT NULL,
  value varchar(255),
  updated timestamp(14),
  accessed timestamp(14),
  comment text,
  KEY index_property_attribute_class (attribute(64),name(64),count)
);

#
# Table structure for table 'property_attribute_device'
#
DROP TABLE IF EXISTS property_attribute_device;
CREATE TABLE property_attribute_device (
  device varchar(255) DEFAULT '' NOT NULL,
  attribute varchar(255) DEFAULT '' NOT NULL,
  name varchar(255) DEFAULT '' NOT NULL,
  count int(11) DEFAULT '0' NOT NULL,
  value varchar(255),
  updated timestamp(14),
  accessed timestamp(14),
  comment text,
  KEY index_property_attribute_device (attribute(64),name(64),count)
);

#
# Table structure for table 'property_class'
#
DROP TABLE IF EXISTS property_class;
CREATE TABLE property_class (
  class varchar(255) DEFAULT '' NOT NULL,
  name varchar(255) DEFAULT '' NOT NULL,
  count int(11) DEFAULT '0' NOT NULL,
  value varchar(255),
  updated timestamp(14),
  accessed timestamp(14),
  comment text,
  KEY index_property (class(64),name(64),count)
);

#
# Table structure for table 'property_device'
#
DROP TABLE IF EXISTS property_device;
CREATE TABLE property_device (
  device varchar(255) DEFAULT '' NOT NULL,
  name varchar(255) DEFAULT '' NOT NULL,
  count int(11) DEFAULT '0' NOT NULL,
  value varchar(255),
  updated timestamp(14),
  accessed timestamp(14),
  comment text,
  KEY index_resource (device(64),name(64),count)
);

#
# Table structure for table 'server'
#
DROP TABLE IF EXISTS server;
CREATE TABLE server (
  name varchar(255) DEFAULT '' NOT NULL,
  host varchar(255) DEFAULT '' NOT NULL,
  mode int(11) DEFAULT '0',
  level int(11) DEFAULT '0'
);

