package uk.ac.ic.wlgitbridge.writelatex.model.db.sql.update.create;

import uk.ac.ic.wlgitbridge.writelatex.model.db.sql.SQLUpdate;

import java.sql.PreparedStatement;
import java.sql.SQLException;

/**
 * Created by Winston on 21/02/15.
 */
public class CreateIndexURLIndexStore implements SQLUpdate {

    public static final String CREATE_INDEX_URL_INDEX_STORE = "CREATE INDEX `project_path_index` ON `url_index_store`(`project_name`, `path`);\n";

    @Override
    public String getSQL() {
        return CREATE_INDEX_URL_INDEX_STORE;
    }

    @Override
    public void addParametersToStatement(PreparedStatement statement) throws SQLException {

    }

}

@@ -358,16 +358,28 @@
 _STORE =
+%0A           
  %22CREATE
@@ -385,16 +385,30 @@
 E INDEX 
+IF NOT EXISTS 
 %60project

Add IF NOT EXISTS to index creation sql statement.