Fix url index bug with renaming.

This commit is contained in:
Winston Li 2015-02-22 10:56:47 +00:00
parent ad7c7a4ba5
commit 4561409450
2 changed files with 2 additions and 2 deletions

View file

@ -11,7 +11,7 @@ import java.sql.SQLException;
public class CreateIndexURLIndexStore implements SQLUpdate {
public static final String CREATE_INDEX_URL_INDEX_STORE =
"CREATE INDEX IF NOT EXISTS `project_path_index` ON `url_index_store`(`project_name`, `path`);\n";
"CREATE UNIQUE INDEX IF NOT EXISTS `project_path_index` ON `url_index_store`(`project_name`, `path`);\n";
@Override
public String getSQL() {

View file

@ -11,7 +11,7 @@ import java.sql.SQLException;
public class AddURLIndexSQLUpdate implements SQLUpdate {
private static final String ADD_URL_INDEX =
"INSERT INTO `url_index_store` (`project_name`, `url`, `path`) VALUES (?, ?, ?);\n";
"INSERT OR REPLACE INTO `url_index_store` (`project_name`, `url`, `path`) VALUES (?, ?, ?);\n";
private final String projectName;
private final String url;