Introduces tags in db context

vnext
Paul Schneider 8 years ago
parent cef5675ad9
commit 54a682cdf2
2 changed files with 5 additions and 2 deletions

@ -1,8 +1,6 @@
using System; using System;
using Microsoft.Data.Entity; using Microsoft.Data.Entity;
using Microsoft.Data.Entity.Infrastructure; using Microsoft.Data.Entity.Infrastructure;
using Microsoft.Data.Entity.Metadata;
using Microsoft.Data.Entity.Migrations;
using Yavsc.Models; using Yavsc.Models;
namespace Yavsc.Migrations namespace Yavsc.Migrations

@ -28,6 +28,7 @@ namespace Yavsc.Models
builder.Entity<BookQuery>().Property(x=>x.CreationDate).HasDefaultValueSql("LOCALTIMESTAMP"); builder.Entity<BookQuery>().Property(x=>x.CreationDate).HasDefaultValueSql("LOCALTIMESTAMP");
builder.Entity<Blog>().Property(x=>x.Posted).HasDefaultValueSql("LOCALTIMESTAMP"); builder.Entity<Blog>().Property(x=>x.Posted).HasDefaultValueSql("LOCALTIMESTAMP");
builder.Entity<GoogleCloudMobileDeclaration>().Property(x=>x.DeclarationDate).HasDefaultValueSql("LOCALTIMESTAMP"); builder.Entity<GoogleCloudMobileDeclaration>().Property(x=>x.DeclarationDate).HasDefaultValueSql("LOCALTIMESTAMP");
builder.Entity<PostTag>().HasKey(x=>new { x.PostId, x.TagId});
} }
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
@ -173,5 +174,9 @@ namespace Yavsc.Models
public DbSet<ExceptionSIREN> ExceptionsSIREN { get; set; } public DbSet<ExceptionSIREN> ExceptionsSIREN { get; set; }
public DbSet<Location> Locations { get; set; } public DbSet<Location> Locations { get; set; }
public DbSet<Tag> Tags { get; set; }
public DbSet<PostTag> TagsDomain { get; set; }
} }
} }

Loading…