DO NOT DOWNLOAD. DOWNLOAD LATEST STABLE FROM RELEASE TAB

Did someone say recycle bin in media? Works but needs one more tweak.
Data layer optimizations for Document & Media.
Database upgrade scripts (not created for Vista DB yet).
YOU NEED TO RUN THE INSTALLER TO UPGRADE THE DB, AND MAKE SURE YOU DELETE ALL FILES IN ~/data/ClientDependency


[TFS Changeset #58546]
This commit is contained in:
Shandem
2009-08-31 15:05:47 +00:00
parent 52d1fe6b02
commit 3d087dc07f
28 changed files with 894 additions and 273 deletions

View File

@@ -20,6 +20,8 @@ namespace umbraco.DataLayer.Utility.Installer
/// <summary>Umbraco version 3.0.</summary>
Version3,
/// <summary>Umbraco version 4.0.</summary>
Version4
Version4,
/// <summary>Umbraco version 4.1.</summary>
Version4_1
}
}

View File

@@ -185,10 +185,16 @@ namespace umbraco.DataLayer.Utility.Installer
{
try
{
if (String.IsNullOrEmpty(v.Table))
SqlHelper.ExecuteNonQuery(string.Format("SELECT {0}", v.Field));
else
SqlHelper.ExecuteNonQuery(string.Format("SELECT {0} FROM {1}", v.Field, v.Table));
if (!String.IsNullOrEmpty(v.Table) && !String.IsNullOrEmpty(v.Field) && !String.IsNullOrEmpty(v.Value))
{
IRecordsReader reader = SqlHelper.ExecuteReader(string.Format("SELECT {0} FROM {1} WHERE {0}={2}", v.Field, v.Table, v.Value));
if (!reader.HasRecords)
continue;
}
else if (String.IsNullOrEmpty(v.Table))
SqlHelper.ExecuteNonQuery(string.Format("SELECT {0}", v.Field));
else
SqlHelper.ExecuteNonQuery(string.Format("SELECT {0} FROM {1}", v.Field, v.Table));
return v.Version;
}
catch { }
@@ -223,12 +229,20 @@ namespace umbraco.DataLayer.Utility.Installer
/// if a <c>SELECT</c> statement of <c>Field FROM Table</c> succeeds,
/// the database version is at least <c>Version</c>.
/// </summary>
/// <remarks>
/// This also supports checking for a value in a table.
/// </remarks>
public struct VersionSpecs
{
/// <summary>The name of the field that should exist in order to have at least the specified version.</summary>
public readonly string Field;
/// <summary>The name of the table whose field should exist in order to have at least the specified version.</summary>
public readonly string Table;
/// <summary>
/// The value to look for in the field, if this is left empty it will not be queried.
/// </summary>
public readonly string Value;
/// <summary>The minimum version number of a database that contains the specified field.</summary>
public readonly DatabaseVersion Version;
@@ -243,6 +257,21 @@ namespace umbraco.DataLayer.Utility.Installer
Field = field;
Table = table;
Version = version;
Value = "";
}
/// <summary>
/// Initializes a new instance of the <see cref="VersionSpecs"/> struct.
/// </summary>
/// <param name="field">The field.</param>
/// <param name="table">The table.</param>
/// <param name="version">The version.</param>
public VersionSpecs(string field, string table, string value, DatabaseVersion version)
{
Field = field;
Table = table;
Value = value;
Version = version;
}
}
}