@Override
	public String getSqlCreateStatement() {
		StringBuilder sb = new StringBuilder();
		sb.append("CREATE TABLE ").append(dbName).append(" (");
		DatabaseFieldDefinition primaryKey = null;
		List<DatabaseFieldDefinition> uniqueFields = new ArrayList<DatabaseFieldDefinition>();
		for (DatabaseFieldDefinition dbFieldDef : fields) {
			if (dbFieldDef.isPrimaryKey() || dbFieldDef.isUnique()) {
				if (dbFieldDef.isPrimaryKey()) {
					primaryKey = dbFieldDef;
				}
				if (dbFieldDef.isUnique()) {
					uniqueFields.add(dbFieldDef);
				}				
			}
			sb.append(dbFieldDef.getSqlCreateStatement()).append(", ");
		}
		for (DatabaseFieldDefinition dbFieldDef : uniqueFields) {
			sb.append("UNIQUE ").append(dbFieldDef.getDbFieldName()).append(", ");
		}
		if (primaryKey != null) {
			sb.append(" PRIMARY KEY (").append(primaryKey.getDbFieldName()).append(")");
		}
		if (fields.size() > 0) {
			sb.delete(sb.lastIndexOf(", "), sb.length());
		}
		sb.append(")");
		return sb.toString();
	}