Skip to content

Commit

Permalink
Recreated migratoin for sql server for content and seo
Browse files Browse the repository at this point in the history
  • Loading branch information
filipmatsman committed Nov 3, 2020
1 parent 00f4dde commit 31b1a89
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
migrationBuilder.AddColumn<Guid>(
name: "LanguageId",
table: "Piranha_Sites",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
nullable: true);

migrationBuilder.AddColumn<bool>(
name: "MetaFollow",
Expand Down
5 changes: 2 additions & 3 deletions data/Piranha.Data.EF.SQLServer/Migrations/DbModelSnapshot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1139,7 +1139,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property<bool>("IsDefault")
.HasColumnType("bit");

b.Property<Guid>("LanguageId")
b.Property<Guid?>("LanguageId")
.HasColumnType("uniqueidentifier");

b.Property<DateTime>("LastModified")
Expand Down Expand Up @@ -1570,8 +1570,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.HasOne("Piranha.Data.Language", "Language")
.WithMany()
.HasForeignKey("LanguageId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
.OnDelete(DeleteBehavior.Restrict);
});

modelBuilder.Entity("Piranha.Data.SiteField", b =>
Expand Down
2 changes: 1 addition & 1 deletion data/Piranha.Data.EF/Db.cs
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ protected override void OnModelCreating(ModelBuilder mb)
mb.Entity<Data.Site>().Property(s => s.Description).HasMaxLength(256);
mb.Entity<Data.Site>().Property(s => s.Hostnames).HasMaxLength(256);
mb.Entity<Data.Site>().Property(s => s.Culture).HasMaxLength(6);
mb.Entity<Data.Site>().HasOne(s => s.Language).WithMany().IsRequired().OnDelete(DeleteBehavior.Restrict);
mb.Entity<Data.Site>().HasOne(s => s.Language).WithMany().OnDelete(DeleteBehavior.Restrict);
mb.Entity<Data.Site>().HasIndex(s => s.InternalId).IsUnique();


Expand Down

0 comments on commit 31b1a89

Please sign in to comment.