diff --git a/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs b/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs index 4e210d73..11f18eb8 100644 --- a/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/Yavsc/Migrations/ApplicationDbContextModelSnapshot.cs @@ -1,8 +1,6 @@ using System; using Microsoft.Data.Entity; using Microsoft.Data.Entity.Infrastructure; -using Microsoft.Data.Entity.Metadata; -using Microsoft.Data.Entity.Migrations; using Yavsc.Models; namespace Yavsc.Migrations diff --git a/Yavsc/Model/ApplicationDbContext.cs b/Yavsc/Model/ApplicationDbContext.cs index 59741b79..2ca91bc8 100644 --- a/Yavsc/Model/ApplicationDbContext.cs +++ b/Yavsc/Model/ApplicationDbContext.cs @@ -28,6 +28,7 @@ namespace Yavsc.Models builder.Entity().Property(x=>x.CreationDate).HasDefaultValueSql("LOCALTIMESTAMP"); builder.Entity().Property(x=>x.Posted).HasDefaultValueSql("LOCALTIMESTAMP"); builder.Entity().Property(x=>x.DeclarationDate).HasDefaultValueSql("LOCALTIMESTAMP"); + builder.Entity().HasKey(x=>new { x.PostId, x.TagId}); } protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) @@ -173,5 +174,9 @@ namespace Yavsc.Models public DbSet ExceptionsSIREN { get; set; } public DbSet Locations { get; set; } + + public DbSet Tags { get; set; } + + public DbSet TagsDomain { get; set; } } }