private static void Upgrade()
{
var dba = DataAccessBaseEx.GetWorker();
string indexCheck =
"SELECT COUNT(*) FROM sys.indexes WHERE name='NotFoundRequests_ID' AND object_id = OBJECT_ID('[dbo].[BVN.NotFoundRequests]')";
int num = dba.ExecuteScalar(indexCheck);
if (num == 0)
{
if (!dba.ExecuteNonQuery("CREATE CLUSTERED INDEX NotFoundRequests_ID ON [dbo].[BVN.NotFoundRequests] (ID)"))
{
Valid = false;
_log.Error("An error occurred during the creation of the 404 handler redirects clustered index. Canceling.");
}
_log.Information("Create Clustered index END");
}
if (Valid)
{
string versionSP = @"ALTER PROCEDURE [dbo].[bvn_notfoundversion] AS RETURN " + Configuration.Configuration.CURRENT_VERSION;
Valid = dba.ExecuteNonQuery(versionSP);
// TODO: Alter table if necessary
}
}