diff --git a/build/UmbracoVersion.txt b/build/UmbracoVersion.txt index 36ca25b17a..0353e6fdb1 100644 --- a/build/UmbracoVersion.txt +++ b/build/UmbracoVersion.txt @@ -1,2 +1,3 @@ # Usage: on line 2 put the release version, on line 3 put the version comment (example: beta) -7.4.0 \ No newline at end of file +7.4.0 +beta \ No newline at end of file diff --git a/src/Umbraco.Core/Configuration/UmbracoVersion.cs b/src/Umbraco.Core/Configuration/UmbracoVersion.cs index 658e8498e9..f170c325c8 100644 --- a/src/Umbraco.Core/Configuration/UmbracoVersion.cs +++ b/src/Umbraco.Core/Configuration/UmbracoVersion.cs @@ -24,7 +24,7 @@ namespace Umbraco.Core.Configuration /// Gets the version comment (like beta or RC). /// /// The version comment. - public static string CurrentComment { get { return ""; } } + public static string CurrentComment { get { return "beta"; } } // Get the version of the umbraco.dll by looking at a class in that dll // Had to do it like this due to medium trust issues, see: http://haacked.com/archive/2010/11/04/assembly-location-and-medium-trust.aspx diff --git a/src/Umbraco.Core/Models/Rdbms/UmbracoDeployChecksumDto.cs b/src/Umbraco.Core/Models/Rdbms/UmbracoDeployChecksumDto.cs new file mode 100644 index 0000000000..06d904ee88 --- /dev/null +++ b/src/Umbraco.Core/Models/Rdbms/UmbracoDeployChecksumDto.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using Umbraco.Core.Persistence; +using Umbraco.Core.Persistence.DatabaseAnnotations; +using Umbraco.Core.Persistence.DatabaseModelDefinitions; + +namespace Umbraco.Core.Models.Rdbms +{ + [TableName("umbracoDeployChecksum")] + [PrimaryKey("id")] + [ExplicitColumns] + internal class UmbracoDeployChecksumDto + { + [Column("id")] + [PrimaryKeyColumn(Name = "PK_umbracoDeployChecksum")] + public int Id { get; set; } + + [Column("entityType")] + [Length(32)] + [NullSetting(NullSetting = NullSettings.NotNull)] + [Index(IndexTypes.UniqueNonClustered, Name = "IX_umbracoDeployChecksum", ForColumns = "entityType,entityGuid,entityPath")] + public string EntityType { get; set; } + + [Column("entityGuid")] + [NullSetting(NullSetting = NullSettings.Null)] + public Guid EntityGuid { get; set; } + + [Column("entityPath")] + [Length(256)] + [NullSetting(NullSetting = NullSettings.Null)] + public string EntityPath { get; set; } + + [Column("localChecksum")] + [NullSetting(NullSetting = NullSettings.NotNull)] + [Length(32)] + public string LocalChecksum { get; set; } + + [Column("compositeChecksum")] + [NullSetting(NullSetting = NullSettings.Null)] + [Length(32)] + public string CompositeChecksum { get; set; } + } +} \ No newline at end of file diff --git a/src/Umbraco.Core/Models/Rdbms/UmbracoDeployDependencyDto.cs b/src/Umbraco.Core/Models/Rdbms/UmbracoDeployDependencyDto.cs new file mode 100644 index 0000000000..2ba1e32d22 --- /dev/null +++ b/src/Umbraco.Core/Models/Rdbms/UmbracoDeployDependencyDto.cs @@ -0,0 +1,30 @@ +using Umbraco.Core.Persistence; +using Umbraco.Core.Persistence.DatabaseAnnotations; + +namespace Umbraco.Core.Models.Rdbms +{ + [TableName("umbracoDeployDependency")] + [PrimaryKey("id")] + [ExplicitColumns] + internal class UmbracoDeployDependencyDto + { + [Column("id")] + [PrimaryKeyColumn(Name = "PK_umbracoDeployDependency")] + public int Id { get; set; } + + [Column("sourceId")] + [ForeignKey(typeof(UmbracoDeployChecksumDto), Name = "FK_umbracoDeployDependency_umbracoDeployChecksum_id1")] + [NullSetting(NullSetting = NullSettings.NotNull)] + public int SourceId { get; set; } + + [Column("targetId")] + [ForeignKey(typeof(UmbracoDeployChecksumDto), Name = "FK_umbracoDeployDependency_umbracoDeployChecksum_id2")] + [NullSetting(NullSetting = NullSettings.NotNull)] + public int TargetId { get; set; } + + [Column("mode")] + [NullSetting(NullSetting = NullSettings.NotNull)] + public int Mode { get; set; } + + } +} \ No newline at end of file diff --git a/src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaCreation.cs b/src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaCreation.cs index 9ffce4b8de..0ae044d1ee 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaCreation.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaCreation.cs @@ -82,7 +82,9 @@ namespace Umbraco.Core.Persistence.Migrations.Initial {42, typeof (AccessRuleDto)}, {43, typeof(CacheInstructionDto)}, {44, typeof (ExternalLoginDto)}, - {45, typeof (MigrationDto)} + {45, typeof (MigrationDto)}, + {46, typeof (UmbracoDeployChecksumDto)}, + {47, typeof (UmbracoDeployDependencyDto)} }; #endregion diff --git a/src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaResult.cs b/src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaResult.cs index 04d6598d4b..9af6d46fbb 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaResult.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Initial/DatabaseSchemaResult.cs @@ -119,6 +119,12 @@ namespace Umbraco.Core.Persistence.Migrations.Initial return new Version(7, 2, 5); } + //if the error is for umbracoDeployChecksum it must be the previous version to 7.4 since that is when it is added + if (Errors.Any(x => x.Item1.Equals("Table") && (x.Item2.InvariantEquals("umbracoDeployChecksum")))) + { + return new Version(7, 3, 4); + } + return UmbracoVersion.Current; } diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/AddUmbracoDeployTables.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/AddUmbracoDeployTables.cs new file mode 100644 index 0000000000..eb93f9d43a --- /dev/null +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/AddUmbracoDeployTables.cs @@ -0,0 +1,47 @@ +using System.Linq; +using Umbraco.Core.Configuration; +using Umbraco.Core.Logging; +using Umbraco.Core.Persistence.SqlSyntax; + +namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFourZero +{ + [Migration("7.4.0", 5, GlobalSettings.UmbracoMigrationName)] + public class AddUmbracoDeployTables : MigrationBase + { + public AddUmbracoDeployTables(ISqlSyntaxProvider sqlSyntax, ILogger logger) + : base(sqlSyntax, logger) + { } + + public override void Up() + { + //Don't exeucte if the table is already there + var tables = SqlSyntax.GetTablesInSchema(Context.Database).ToArray(); + if (tables.InvariantContains("umbracoDeployChecksum")) return; + + Create.Table("umbracoDeployChecksum") + .WithColumn("id").AsInt32().Identity().PrimaryKey("PK_umbracoDeployChecksum") + .WithColumn("entityType").AsString(32).NotNullable() + .WithColumn("entityGuid").AsGuid().Nullable() + .WithColumn("entityPath").AsString(256).Nullable() + .WithColumn("localChecksum").AsString(32).NotNullable() + .WithColumn("compositeChecksum").AsString(32).Nullable(); + + Create.Table("umbracoDeployDependency") + .WithColumn("id").AsInt32().Identity().PrimaryKey("PK_umbracoDeployDependency") + .WithColumn("sourceId").AsInt32().NotNullable().ForeignKey("FK_umbracoDeployDependency_umbracoDeployChecksum_id1", "umbracoDeployChecksum", "id") + .WithColumn("targetId").AsInt32().NotNullable().ForeignKey("FK_umbracoDeployDependency_umbracoDeployChecksum_id2", "umbracoDeployChecksum", "id") + .WithColumn("mode").AsInt32().NotNullable(); + + Create.Index("IX_umbracoDeployChecksum").OnTable("umbracoDeployChecksum") + .OnColumn("entityType") + .Ascending() + .OnColumn("entityGuid") + .Ascending() + .OnColumn("entityPath") + .Unique(); + } + + public override void Down() + { } + } +} \ No newline at end of file diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/EnsureContentTypeUniqueIdsAreConsistent.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/EnsureContentTypeUniqueIdsAreConsistent.cs index 84877fa4de..20200a3230 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/EnsureContentTypeUniqueIdsAreConsistent.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/EnsureContentTypeUniqueIdsAreConsistent.cs @@ -12,7 +12,7 @@ namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFourZer /// alias, so we need to ensure that these are initially consistent on /// all environments (based on the alias). /// - [Migration("7.4.0", 2, GlobalSettings.UmbracoMigrationName)] + [Migration("7.4.0", 3, GlobalSettings.UmbracoMigrationName)] public class EnsureContentTypeUniqueIdsAreConsistent : MigrationBase { public EnsureContentTypeUniqueIdsAreConsistent(ISqlSyntaxProvider sqlSyntax, ILogger logger) diff --git a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/RemoveParentIdPropertyTypeGroupColumn.cs b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/RemoveParentIdPropertyTypeGroupColumn.cs index 59882a25ec..5d5900308a 100644 --- a/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/RemoveParentIdPropertyTypeGroupColumn.cs +++ b/src/Umbraco.Core/Persistence/Migrations/Upgrades/TargetVersionSevenFourZero/RemoveParentIdPropertyTypeGroupColumn.cs @@ -5,7 +5,7 @@ using Umbraco.Core.Persistence.SqlSyntax; namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenFourZero { - [Migration("7.4.0", 3, GlobalSettings.UmbracoMigrationName)] + [Migration("7.4.0", 4, GlobalSettings.UmbracoMigrationName)] public class RemoveParentIdPropertyTypeGroupColumn : MigrationBase { public RemoveParentIdPropertyTypeGroupColumn(ISqlSyntaxProvider sqlSyntax, ILogger logger) diff --git a/src/Umbraco.Core/Umbraco.Core.csproj b/src/Umbraco.Core/Umbraco.Core.csproj index fb00485640..7f75a85acc 100644 --- a/src/Umbraco.Core/Umbraco.Core.csproj +++ b/src/Umbraco.Core/Umbraco.Core.csproj @@ -394,6 +394,8 @@ + + @@ -409,6 +411,7 @@ +