// DO NOTHING
}
@Override
public void upgrade(EOEditingContext editingContext, ERXMigrationDatabase database) throws Throwable {
ERXMigrationTable sPGroupTable = database.newTableNamed("SPGroup");
sPGroupTable.newStringColumn("description", 1000, true);
sPGroupTable.newStringColumn("groupPassword", 100, true);
sPGroupTable.newIntegerColumn("id", false);
sPGroupTable.newStringColumn("name", 255, false);
sPGroupTable.newIntegerColumn("ownerID", false);
sPGroupTable.create();
sPGroupTable.setPrimaryKey("id");
ERXMigrationTable sPPersonTable = database.newTableNamed("SPPerson");
sPPersonTable.newBooleanColumn("admin", false);
sPPersonTable.newIntegerColumn("avatarID", true);
sPPersonTable.newStringColumn("emailAddress", 255, false);
sPPersonTable.newBooleanColumn("emailDeliveryFailure", false);
sPPersonTable.newIntegerColumn("id", false);
sPPersonTable.newStringColumn("name", 255, false);
sPPersonTable.newStringColumn("password", 100, true);
sPPersonTable.create();
sPPersonTable.setPrimaryKey("id");
ERXMigrationTable sPSecretPalTable = database.newTableNamed("SPSecretPal");
sPSecretPalTable.newIntegerColumn("eventID", false);
sPSecretPalTable.newIntegerColumn("giverID", false);
sPSecretPalTable.newIntegerColumn("id", false);
sPSecretPalTable.newIntegerColumn("receiverID", false);
sPSecretPalTable.create();
sPSecretPalTable.setPrimaryKey("id");
ERXMigrationTable sPWishTable = database.newTableNamed("SPWish");
sPWishTable.newBigDecimalColumn("cost", 38, 4, true);
sPWishTable.newStringColumn("description", 1000, true);
sPWishTable.newIntegerColumn("id", false);
sPWishTable.newBooleanColumn("purchased", false);
sPWishTable.newIntegerColumn("suggestedByID", false);
sPWishTable.newIntegerColumn("suggestedForID", false);
sPWishTable.create();
sPWishTable.setPrimaryKey("id");
ERXMigrationTable sPMembershipTable = database.newTableNamed("SPMembership");
sPMembershipTable.newBooleanColumn("admin", false);
sPMembershipTable.newIntegerColumn("groupID", false);
sPMembershipTable.newIntegerColumn("personID", false);
sPMembershipTable.newStringColumn("confirmationCode", 100, true);
sPMembershipTable.newBooleanColumn("confirmed", false);
sPMembershipTable.create();
sPMembershipTable.setPrimaryKey("groupID", "personID");
ERXMigrationTable sPEventTable = database.newTableNamed("SPEvent");
sPEventTable.newBooleanColumn("active", false);
sPEventTable.newStringColumn("description", 1000, true);
sPEventTable.newIntegerColumn("groupID", false);
sPEventTable.newIntegerColumn("id", false);
sPEventTable.newStringColumn("name", 255, false);
sPEventTable.create();
sPEventTable.setPrimaryKey("id");
sPGroupTable.addForeignKey("ownerID", "SPPerson", "id");
sPPersonTable.addForeignKey("avatarID", "ERAttachment", "id");
sPSecretPalTable.addForeignKey("eventID", "SPEvent", "id");
sPSecretPalTable.addForeignKey("giverID", "SPPerson", "id");
sPSecretPalTable.addForeignKey("receiverID", "SPPerson", "id");
sPWishTable.addForeignKey("suggestedByID", "SPPerson", "id");
sPWishTable.addForeignKey("suggestedForID", "SPPerson", "id");
sPMembershipTable.addForeignKey("groupID", "SPGroup", "id");
sPMembershipTable.addForeignKey("personID", "SPPerson", "id");
sPEventTable.addForeignKey("groupID", "SPGroup", "id");
sPPersonTable.addUniqueIndex("uniqueEmailAddress", "emailAddress");
sPSecretPalTable.addUniqueIndex("uniqueSecretPal", sPSecretPalTable.existingColumnNamed("eventID"), sPSecretPalTable.existingColumnNamed("giverID"), sPSecretPalTable.existingColumnNamed("receiverID"));
}