 -- solver
 create table if not exists solver (
   action_time datetime not null,
-  id unsigned int not null auto increment,
-  primary key (id),
+  id int unsigned not null auto_increment,
+  primary key (id)
 );
 create unique index solver_idx01 on solver(action_time);
 
 create table if not exists solver_params (
-  solver_id unsigned int not null
+  solver_id int unsigned not null,
   romFileName tinytext,
   preset tinytext,
-  difficultyTarget unsigned tinyint,
+  difficultyTarget tinyint unsigned,
   pickupStrategy tinytext,
   primary key (solver_id),
   foreign key (solver_id) references solver(id)
 );
 
 create table if not exists solver_items_forbidden (
-  solver_id unsigned int not null,
-  item tinytext not null,
+  solver_id int unsigned not null,
+  item varchar(255) not null,
   primary key (solver_id, item),
   foreign key (solver_id) references solver(id)
 );
 
 create table if not exists solver_result (
-  solver_id unsigned int not null,
+  solver_id int unsigned not null,
   return_code tinyint,
   duration time,
   randomized_rom tinytext,


--randomizer
create table if not exists randomizer (
  id unsigned int not null auto increment,
  action_time datetime not null,
  primary key (id),
);
create unique index randomizer_idx01 on randomizer(action_time);

create table if not exists randomizer_params (
  randomizer_id unsigned int not null,
  name tinytext not null,
  value text,
  primary key (id, tinytext),
  foreign key (randomizer_id) references randomizer(id)
);

create table if not exists randomizer_result (
  randomizer_id unsigned int not null,
  return_code tinyint,
  duration time,
  error_msg text,

  knows_used tinyint,
  knows_known tinyint,
  items_ok bool,
  len_remainTry tinyint unsigned,
  len_remainMajors tinyint unsigned,
  len_remainMinors tinyint unsigned,
  len_skippedMajors tinyint unsigned,
  len_unavailMajors tinyint unsigned,
  primary key (solver_id),
  foreign key (solver_id) references solver(id)
);

create table if not exists solver_collected_items (
  solver_id int unsigned not null,
  item varchar(255) not null,
  count tinyint not null,
  primary key (solver_id, item),
  foreign key (solver_id) references solver(id)
