create table ACTIVITY (
  `DAY` date,
  `DURATION` bigint(20),
  `ID_INTERNAL` int(11) NOT NULL auto_increment,
  `KEY_DEVELOPER` int(11),
  `KEY_ITERATION` int(11),
  `KEY_WORK_ITEM` int(11),
  primary key (ID_INTERNAL),
  index (KEY_DEVELOPER),
  index (KEY_ITERATION),
  index (KEY_WORK_ITEM)
) type=InnoDB ;



create table ASSIGNMENT (
  `ID_INTERNAL` int(11) NOT NULL auto_increment,
  `INSTANT` timestamp NULL default NULL,
  `KEY_ASSIGNER` int(11),
  primary key (ID_INTERNAL),
  index (KEY_ASSIGNER)
) type=InnoDB ;



create table ASSIGNMENTS (
  `KEY_ASSIGNMENT` int(11),
  `KEY_PERSON` int(11),
  primary key (KEY_ASSIGNMENT, KEY_PERSON)
) type=InnoDB ;



create table COMMENT (
  `ID_INTERNAL` int(11) NOT NULL auto_increment,
  `KEY_COMMENTED` int(11),
  `KEY_REPLIED` int(11),
  `KEY_WRITER` int(11),
  `PUBLICATION` timestamp NULL default NULL,
  `TEXT` text,
  primary key (ID_INTERNAL),
  index (KEY_COMMENTED),
  index (KEY_REPLIED),
  index (KEY_WRITER)
) type=InnoDB ;



create table COMPOSITION_CHILDREN (
  `KEY_COMPOSITION` int(11),
  `KEY_WORK_ITEM` int(11),
  primary key (KEY_COMPOSITION, KEY_WORK_ITEM)
) type=InnoDB ;



create table DEPENDENCY (
  `ID_INTERNAL` int(11) NOT NULL auto_increment,
  `INSTANT` timestamp NULL default NULL,
  `KEY_DEPENDENCY_SOURCE` int(11),
  `KEY_ITERATION` int(11),
  `KEY_WRITER` int(11),
  primary key (ID_INTERNAL),
  index (KEY_DEPENDENCY_SOURCE),
  index (KEY_ITERATION),
  index (KEY_WRITER)
) type=InnoDB ;



create table META_PROPERTY (
  `CLAZZ` text,
  `ID_INTERNAL` int(11) NOT NULL auto_increment,
  `KEY_PROJECT` int(11),
  `NAME` text,
  primary key (ID_INTERNAL),
  index (KEY_PROJECT)
) type=InnoDB ;



create table PAWS_REPOSITORY (
  `ID_INTERNAL` int(11) NOT NULL auto_increment,
  primary key (ID_INTERNAL)
) type=InnoDB ;



create table PERSON (
  `EMAIL` text,
  `ID_INTERNAL` int(11) NOT NULL auto_increment,
  `KEY_PAWS_REPOSITORY` int(11),
  `KEY_ROLE` int(11),
  `KEY_TEAM` int(11),
  `NAME` text,
  `PASSWORD` text,
  `USERNAME` text,
  primary key (ID_INTERNAL),
  index (KEY_PAWS_REPOSITORY),
  index (KEY_ROLE),
  index (KEY_TEAM)
) type=InnoDB ;



create table PLAN (
  `ID_INTERNAL` int(11) NOT NULL auto_increment,
  `INSTANT` timestamp NULL default NULL,
  `KEY_ITERATION` int(11),
  `KEY_PLANNER` int(11),
  `KEY_WORK_ITEM` int(11),
  `PERIOD` blob,
  primary key (ID_INTERNAL),
  index (KEY_ITERATION),
  index (KEY_PLANNER),
  index (KEY_WORK_ITEM)
) type=InnoDB ;



create table PRECEDENCE_BEFORES (
  `KEY_PRECEDENCE` int(11),
  `KEY_WORK_ITEM` int(11),
  primary key (KEY_PRECEDENCE, KEY_WORK_ITEM)
) type=InnoDB ;



create table PROPERTY (
  `ID_INTERNAL` int(11) NOT NULL auto_increment,
  `KEY_META` int(11),
  `KEY_THEME` int(11),
  `KEY_WORK_DEFINITION` int(11),
  `VALUE` timestamp NULL default NULL,
  primary key (ID_INTERNAL),
  index (KEY_META),
  index (KEY_THEME),
  index (KEY_WORK_DEFINITION)
) type=InnoDB ;



create table ROLE (
  `ID_INTERNAL` int(11) NOT NULL auto_increment,
  `NAME` text,
  primary key (ID_INTERNAL)
) type=InnoDB ;



create table WORK_DEFINITION (
  `CREATION` timestamp NULL default NULL,
  `DESCRIPTION` text,
  `ID_INTERNAL` int(11) NOT NULL auto_increment,
  `KEY_OWNER` int(11),
  `KEY_PARENT` int(11),
  `KEY_PAWS_REPOSITORY` int(11),
  `KEY_PROJECT` int(11),
  `KEY_TEAM` int(11),
  `KEY_THEME_PROPERTY` int(11),
  `LAST_CHANGE` timestamp NULL default NULL,
  `NAME` text,
  `SUB_TYPE` text,
  `TIMESPAN` blob,
  `TYPE` text,
  primary key (ID_INTERNAL),
  index (KEY_OWNER),
  index (KEY_PARENT),
  index (KEY_PAWS_REPOSITORY),
  index (KEY_PROJECT),
  index (KEY_TEAM),
  index (KEY_THEME_PROPERTY)
) type=InnoDB ;



insert into ROOT_DOMAIN_OBJECT (ID_INTERNAL) values (1);

