private TableDescriptor CreateRoles(DatabaseService ds)
 {
     var kd = new KeyDescriptor("Id");
     var td = new TableDescriptor("Roles");
     td.AddField("Id", ds.GetFieldDescriptor("guid"));
     td.AddField("UsersId", ds.GetFieldDescriptor("guid"));
     td.AddField("Role", ds.GetFieldDescriptor("role"));
     td.SetPrimaryKey(kd);
     kd = new KeyDescriptor("UsersId");
     kd.SetType(true, false, true);
     td.AddKey(kd);
     return td;
 }
 private TableDescriptor CreateUsers(DatabaseService ds)
 {
     var kd = new KeyDescriptor("Id");
     var td = new TableDescriptor("Users");
     td.AddField("Id", ds.GetFieldDescriptor("guid"));
     td.AddField("Username", ds.GetFieldDescriptor("username"));
     td.AddField("Password", ds.GetFieldDescriptor("password"));
     td.AddField("Nickname", ds.GetFieldDescriptor("nickname"));
     td.SetPrimaryKey(kd);
     kd = new KeyDescriptor("Username");
     kd.SetType(true, false, true);
     td.AddKey(kd);
     return td;
 }
 private TableDescriptor CreateQueue(DatabaseService ds)
 {
     var kd = new KeyDescriptor("Id");
     var td = new TableDescriptor("Queue");
     td.AddField("Id", ds.GetFieldDescriptor("guid"));
     td.AddField("UsersId", ds.GetFieldDescriptor("guid"));
     td.AddField("Message", ds.GetFieldDescriptor("message"));
     td.AddField("MessageType", ds.GetFieldDescriptor("messagetype"));
     td.AddField("Destination", ds.GetFieldDescriptor("destination"));
     td.SetPrimaryKey(kd);
     kd = new KeyDescriptor("UsersId");
     kd.SetType(true, false, true);
     td.AddKey(kd);
     kd = new KeyDescriptor("Destination");
     kd.SetType(false, false, true);
     td.AddKey(kd);
     kd = new KeyDescriptor("MessageType");
     kd.SetType(false, false, true);
     td.AddKey(kd);
     return td;
 }