Un utilisitateur a plusieurs profiles
Il en a un préféré. Il peux en saisir de tout type.main
parent
acf0b8f312
commit
48c9af0917
@ -0,0 +1,158 @@
|
||||
using System.Linq;
|
||||
using System.Security.Claims;
|
||||
using Microsoft.AspNet.Authorization;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
using Microsoft.AspNet.Mvc.Rendering;
|
||||
using Microsoft.Data.Entity;
|
||||
using Yavsc.Models;
|
||||
using Yavsc.Models.Workflow;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
[Authorize]
|
||||
public class DoController : Controller
|
||||
{
|
||||
private ApplicationDbContext _context;
|
||||
|
||||
public DoController(ApplicationDbContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
|
||||
// GET: Do
|
||||
[HttpGet,ActionName("Index")]
|
||||
public IActionResult Index(string id)
|
||||
{
|
||||
if (id == null)
|
||||
id = User.GetUserId();
|
||||
|
||||
var applicationDbContext = _context.UserActivities.Include(u => u.Does).Include(u => u.User).Where(u=> u.UserId == id);
|
||||
return View(applicationDbContext.ToList());
|
||||
}
|
||||
|
||||
// GET: Do/Details/5
|
||||
public IActionResult Details(long? id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
UserActivity userActivity = _context.UserActivities.Single(m => m.Id == id);
|
||||
if (userActivity == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
return View(userActivity);
|
||||
}
|
||||
|
||||
// GET: Do/Create
|
||||
[ActionName("Create"),Authorize]
|
||||
public IActionResult Create(string userId)
|
||||
{
|
||||
if (userId==null)
|
||||
userId = User.GetUserId();
|
||||
ViewBag.DoesCode = new SelectList(_context.Activities, "Code", "Name");
|
||||
//ViewData["UserId"] = userId;
|
||||
ViewBag.UserId = new SelectList(_context.Performers.Include(p=>p.Performer), "PerformerId", "Performer", userId);
|
||||
return View();
|
||||
}
|
||||
|
||||
// POST: Do/Create
|
||||
[HttpPost(),ActionName("Create"),Authorize]
|
||||
[ValidateAntiForgeryToken]
|
||||
public IActionResult Create(UserActivity userActivity)
|
||||
{
|
||||
var uid = User.GetUserId();
|
||||
if (!User.IsInRole("Administrator"))
|
||||
if (uid != userActivity.UserId)
|
||||
ModelState.AddModelError("User","You're not admin.");
|
||||
if (userActivity.UserId == null) userActivity.UserId = uid;
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
_context.UserActivities.Add(userActivity);
|
||||
_context.SaveChanges();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
ViewBag.DoesCode = new SelectList(_context.Activities, "Code", "Name", userActivity.DoesCode);
|
||||
ViewBag.UserId = new SelectList(_context.Performers.Include(p=>p.Performer), "PerformerId", "User", userActivity.UserId);
|
||||
return View(userActivity);
|
||||
}
|
||||
|
||||
// GET: Do/Edit/5
|
||||
[Authorize]
|
||||
public IActionResult Edit(long? id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
UserActivity userActivity = _context.UserActivities.Single(m => m.Id == id);
|
||||
if (userActivity == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
ViewData["DoesCode"] = new SelectList(_context.Activities, "Code", "Does", userActivity.DoesCode);
|
||||
ViewData["UserId"] = new SelectList(_context.Performers, "PerformerId", "User", userActivity.UserId);
|
||||
return View(userActivity);
|
||||
}
|
||||
|
||||
// POST: Do/Edit/5
|
||||
[HttpPost,Authorize]
|
||||
[ValidateAntiForgeryToken]
|
||||
public IActionResult Edit(UserActivity userActivity)
|
||||
{
|
||||
if (!User.IsInRole("Administrator"))
|
||||
if (User.GetUserId() != userActivity.UserId)
|
||||
ModelState.AddModelError("User","You're not admin.");
|
||||
if (ModelState.IsValid)
|
||||
{
|
||||
_context.Update(userActivity);
|
||||
_context.SaveChanges();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
ViewData["DoesCode"] = new SelectList(_context.Activities, "Code", "Does", userActivity.DoesCode);
|
||||
ViewData["UserId"] = new SelectList(_context.Performers, "PerformerId", "User", userActivity.UserId);
|
||||
return View(userActivity);
|
||||
}
|
||||
|
||||
// GET: Do/Delete/5
|
||||
[ActionName("Delete"),Authorize]
|
||||
public IActionResult Delete(long? id)
|
||||
{
|
||||
if (id == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
UserActivity userActivity = _context.UserActivities.Single(m => m.Id == id);
|
||||
|
||||
if (userActivity == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
}
|
||||
if (!User.IsInRole("Administrator"))
|
||||
if (User.GetUserId() != userActivity.UserId)
|
||||
ModelState.AddModelError("User","You're not admin.");
|
||||
return View(userActivity);
|
||||
}
|
||||
|
||||
// POST: Do/Delete/5
|
||||
[HttpPost, ActionName("Delete"),Authorize]
|
||||
[ValidateAntiForgeryToken]
|
||||
public IActionResult DeleteConfirmed(long id)
|
||||
{
|
||||
UserActivity userActivity = _context.UserActivities.Single(m => m.Id == id);
|
||||
if (!User.IsInRole("Administrator"))
|
||||
if (User.GetUserId() != userActivity.UserId) {
|
||||
ModelState.AddModelError("User","You're not admin.");
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
_context.UserActivities.Remove(userActivity);
|
||||
_context.SaveChanges();
|
||||
return RedirectToAction("Index");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,944 @@
|
||||
using System;
|
||||
using Microsoft.Data.Entity;
|
||||
using Microsoft.Data.Entity.Infrastructure;
|
||||
using Microsoft.Data.Entity.Migrations;
|
||||
using Yavsc.Models;
|
||||
|
||||
namespace Yavsc.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationDbContext))]
|
||||
[Migration("20170106144035_activityRate")]
|
||||
partial class activityRate
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "7.0.0-rc1-16348");
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityRole", b =>
|
||||
{
|
||||
b.Property<string>("Id");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken();
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasAnnotation("MaxLength", 256);
|
||||
|
||||
b.Property<string>("NormalizedName")
|
||||
.HasAnnotation("MaxLength", 256);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedName")
|
||||
.HasAnnotation("Relational:Name", "RoleNameIndex");
|
||||
|
||||
b.HasAnnotation("Relational:TableName", "AspNetRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityRoleClaim<string>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("ClaimType");
|
||||
|
||||
b.Property<string>("ClaimValue");
|
||||
|
||||
b.Property<string>("RoleId")
|
||||
.IsRequired();
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasAnnotation("Relational:TableName", "AspNetRoleClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserClaim<string>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("ClaimType");
|
||||
|
||||
b.Property<string>("ClaimValue");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.IsRequired();
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasAnnotation("Relational:TableName", "AspNetUserClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserLogin<string>", b =>
|
||||
{
|
||||
b.Property<string>("LoginProvider");
|
||||
|
||||
b.Property<string>("ProviderKey");
|
||||
|
||||
b.Property<string>("ProviderDisplayName");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.IsRequired();
|
||||
|
||||
b.HasKey("LoginProvider", "ProviderKey");
|
||||
|
||||
b.HasAnnotation("Relational:TableName", "AspNetUserLogins");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserRole<string>", b =>
|
||||
{
|
||||
b.Property<string>("UserId");
|
||||
|
||||
b.Property<string>("RoleId");
|
||||
|
||||
b.HasKey("UserId", "RoleId");
|
||||
|
||||
b.HasAnnotation("Relational:TableName", "AspNetUserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Location", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Address")
|
||||
.IsRequired()
|
||||
.HasAnnotation("MaxLength", 512);
|
||||
|
||||
b.Property<double>("Latitude");
|
||||
|
||||
b.Property<double>("Longitude");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Model.Bank.BankIdentity", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("AccountNumber")
|
||||
.HasAnnotation("MaxLength", 15);
|
||||
|
||||
b.Property<string>("BIC")
|
||||
.HasAnnotation("MaxLength", 15);
|
||||
|
||||
b.Property<string>("BankCode")
|
||||
.HasAnnotation("MaxLength", 5);
|
||||
|
||||
b.Property<int>("BankedKey");
|
||||
|
||||
b.Property<string>("IBAN")
|
||||
.HasAnnotation("MaxLength", 33);
|
||||
|
||||
b.Property<string>("WicketCode")
|
||||
.HasAnnotation("MaxLength", 5);
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Access.BlackListed", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("OwnerId");
|
||||
|
||||
b.Property<string>("UserId");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.AccountBalance", b =>
|
||||
{
|
||||
b.Property<string>("UserId");
|
||||
|
||||
b.Property<long>("ContactCredits");
|
||||
|
||||
b.Property<decimal>("Credits");
|
||||
|
||||
b.HasKey("UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Activity", b =>
|
||||
{
|
||||
b.Property<string>("Code")
|
||||
.HasAnnotation("MaxLength", 512);
|
||||
|
||||
b.Property<string>("ActorDenomination");
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
b.Property<string>("ModeratorGroupName");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasAnnotation("MaxLength", 512);
|
||||
|
||||
b.Property<string>("ParentCode")
|
||||
.HasAnnotation("MaxLength", 512);
|
||||
|
||||
b.Property<string>("Photo");
|
||||
|
||||
b.Property<int>("Rate");
|
||||
|
||||
b.HasKey("Code");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.ApplicationUser", b =>
|
||||
{
|
||||
b.Property<string>("Id");
|
||||
|
||||
b.Property<int>("AccessFailedCount");
|
||||
|
||||
b.Property<string>("Avatar")
|
||||
.HasAnnotation("MaxLength", 512);
|
||||
|
||||
b.Property<long?>("BankInfoId");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken();
|
||||
|
||||
b.Property<string>("DedicatedGoogleCalendar");
|
||||
|
||||
b.Property<long>("DiskQuota");
|
||||
|
||||
b.Property<long>("DiskUsage");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasAnnotation("MaxLength", 256);
|
||||
|
||||
b.Property<bool>("EmailConfirmed");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.HasAnnotation("MaxLength", 512);
|
||||
|
||||
b.Property<bool>("LockoutEnabled");
|
||||
|
||||
b.Property<DateTimeOffset?>("LockoutEnd");
|
||||
|
||||
b.Property<string>("NormalizedEmail")
|
||||
.HasAnnotation("MaxLength", 256);
|
||||
|
||||
b.Property<string>("NormalizedUserName")
|
||||
.HasAnnotation("MaxLength", 256);
|
||||
|
||||
b.Property<string>("PasswordHash");
|
||||
|
||||
b.Property<string>("PhoneNumber");
|
||||
|
||||
b.Property<bool>("PhoneNumberConfirmed");
|
||||
|
||||
b.Property<long?>("PostalAddressId");
|
||||
|
||||
b.Property<string>("SecurityStamp");
|
||||
|
||||
b.Property<bool>("TwoFactorEnabled");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasAnnotation("MaxLength", 256);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedEmail")
|
||||
.HasAnnotation("Relational:Name", "EmailIndex");
|
||||
|
||||
b.HasIndex("NormalizedUserName")
|
||||
.HasAnnotation("Relational:Name", "UserNameIndex");
|
||||
|
||||
b.HasAnnotation("Relational:TableName", "AspNetUsers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Auth.Client", b =>
|
||||
{
|
||||
b.Property<string>("Id");
|
||||
|
||||
b.Property<bool>("Active");
|
||||
|
||||
b.Property<string>("DisplayName");
|
||||
|
||||
b.Property<string>("LogoutRedirectUri")
|
||||
.HasAnnotation("MaxLength", 100);
|
||||
|
||||
b.Property<string>("RedirectUri");
|
||||
|
||||
b.Property<int>("RefreshTokenLifeTime");
|
||||
|
||||
b.Property<string>("Secret");
|
||||
|
||||
b.Property<int>("Type");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Auth.RefreshToken", b =>
|
||||
{
|
||||
b.Property<string>("Id");
|
||||
|
||||
b.Property<string>("ClientId")
|
||||
.IsRequired()
|
||||
.HasAnnotation("MaxLength", 50);
|
||||
|
||||
b.Property<DateTime>("ExpiresUtc");
|
||||
|
||||
b.Property<DateTime>("IssuedUtc");
|
||||
|
||||
b.Property<string>("ProtectedTicket")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<string>("Subject")
|
||||
.IsRequired()
|
||||
.HasAnnotation("MaxLength", 50);
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.BalanceImpact", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("BalanceId")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<DateTime>("ExecDate");
|
||||
|
||||
b.Property<decimal>("Impact");
|
||||
|
||||
b.Property<string>("Reason")
|
||||
.IsRequired();
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Billing.CommandLine", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<long?>("ArticleId");
|
||||
|
||||
b.Property<int>("Count");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasAnnotation("MaxLength", 512);
|
||||
|
||||
b.Property<long>("EstimateId");
|
||||
|
||||
b.Property<long?>("EstimateTemplateId");
|
||||
|
||||
b.Property<decimal>("UnitaryCost");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Billing.Estimate", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("AttachedFilesString");
|
||||
|
||||
b.Property<string>("AttachedGraphicsString");
|
||||
|
||||
b.Property<string>("ClientId")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<DateTime>("ClientValidationDate");
|
||||
|
||||
b.Property<long?>("CommandId");
|
||||
|
||||
b.Property<string>("CommandType");
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
b.Property<string>("OwnerId")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<DateTime>("ProviderValidationDate");
|
||||
|
||||
b.Property<string>("Title");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Billing.EstimateTemplate", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
b.Property<string>("OwnerId")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<string>("Title");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Billing.ExceptionSIREN", b =>
|
||||
{
|
||||
b.Property<string>("SIREN");
|
||||
|
||||
b.HasKey("SIREN");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Blog", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("AuthorId");
|
||||
|
||||
b.Property<string>("Content");
|
||||
|
||||
b.Property<DateTime>("Modified");
|
||||
|
||||
b.Property<string>("Photo");
|
||||
|
||||
b.Property<DateTime>("Posted")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("Relational:GeneratedValueSql", "LOCALTIMESTAMP");
|
||||
|
||||
b.Property<int>("Rate");
|
||||
|
||||
b.Property<string>("Title");
|
||||
|
||||
b.Property<bool>("Visible");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Booking.BookQuery", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("ClientId")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("Relational:GeneratedValueSql", "LOCALTIMESTAMP");
|
||||
|
||||
b.Property<DateTime>("EventDate");
|
||||
|
||||
b.Property<long?>("LocationId");
|
||||
|
||||
b.Property<long?>("LocationTypeId");
|
||||
|
||||
b.Property<string>("PerformerId")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<decimal?>("Previsional");
|
||||
|
||||
b.Property<string>("Reason");
|
||||
|
||||
b.Property<DateTime?>("ValidationDate");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Booking.Instrument", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasAnnotation("MaxLength", 255);
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Booking.MusicalPreference", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasAnnotation("MaxLength", 255);
|
||||
|
||||
b.Property<string>("OwnerProfileId");
|
||||
|
||||
b.Property<int>("Rate");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Booking.MusicalTendency", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasAnnotation("MaxLength", 255);
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Chat.Connection", b =>
|
||||
{
|
||||
b.Property<string>("ConnectionId");
|
||||
|
||||
b.Property<string>("ApplicationUserId");
|
||||
|
||||
b.Property<bool>("Connected");
|
||||
|
||||
b.Property<string>("UserAgent");
|
||||
|
||||
b.HasKey("ConnectionId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Circle", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("ApplicationUserId");
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<string>("OwnerId");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.CircleMember", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<long>("CircleId");
|
||||
|
||||
b.Property<string>("MemberId")
|
||||
.IsRequired();
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Contact", b =>
|
||||
{
|
||||
b.Property<string>("OwnerId");
|
||||
|
||||
b.Property<string>("UserId");
|
||||
|
||||
b.Property<string>("ApplicationUserId");
|
||||
|
||||
b.HasKey("OwnerId", "UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Identity.GoogleCloudMobileDeclaration", b =>
|
||||
{
|
||||
b.Property<string>("DeviceId");
|
||||
|
||||
b.Property<DateTime>("DeclarationDate")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("Relational:GeneratedValueSql", "LOCALTIMESTAMP");
|
||||
|
||||
b.Property<string>("DeviceOwnerId");
|
||||
|
||||
b.Property<string>("GCMRegistrationId")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<string>("Model");
|
||||
|
||||
b.Property<string>("Platform");
|
||||
|
||||
b.Property<string>("Version");
|
||||
|
||||
b.HasKey("DeviceId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Market.BaseProduct", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
b.Property<string>("Discriminator")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<bool>("Public");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasAnnotation("Relational:DiscriminatorProperty", "Discriminator");
|
||||
|
||||
b.HasAnnotation("Relational:DiscriminatorValue", "BaseProduct");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Market.Service", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("ContextId");
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<bool>("Public");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Messaging.ClientProviderInfo", b =>
|
||||
{
|
||||
b.Property<string>("UserId");
|
||||
|
||||
b.Property<string>("Avatar");
|
||||
|
||||
b.Property<long?>("BillingAddressId");
|
||||
|
||||
b.Property<string>("EMail");
|
||||
|
||||
b.Property<string>("Phone");
|
||||
|
||||
b.Property<string>("UserName");
|
||||
|
||||
b.HasKey("UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.OAuth.OAuth2Tokens", b =>
|
||||
{
|
||||
b.Property<string>("UserId");
|
||||
|
||||
b.Property<string>("AccessToken");
|
||||
|
||||
b.Property<DateTime>("Expiration");
|
||||
|
||||
b.Property<string>("ExpiresIn");
|
||||
|
||||
b.Property<string>("RefreshToken");
|
||||
|
||||
b.Property<string>("TokenType");
|
||||
|
||||
b.HasKey("UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.PostTag", b =>
|
||||
{
|
||||
b.Property<long>("PostId");
|
||||
|
||||
b.Property<long>("TagId");
|
||||
|
||||
b.HasKey("PostId", "TagId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Relationship.LocationType", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Skill", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<int>("Rate");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Tag", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired();
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Workflow.PerformerProfile", b =>
|
||||
{
|
||||
b.Property<string>("PerformerId");
|
||||
|
||||
b.Property<bool>("AcceptGeoLocalization");
|
||||
|
||||
b.Property<bool>("AcceptNotifications");
|
||||
|
||||
b.Property<bool>("AcceptPublicContact");
|
||||
|
||||
b.Property<bool>("Active");
|
||||
|
||||
b.Property<int?>("MaxDailyCost");
|
||||
|
||||
b.Property<int?>("MinDailyCost");
|
||||
|
||||
b.Property<long?>("OfferId");
|
||||
|
||||
b.Property<long>("OrganizationAddressId");
|
||||
|
||||
b.Property<int>("Rate");
|
||||
|
||||
b.Property<string>("SIREN")
|
||||
.IsRequired()
|
||||
.HasAnnotation("MaxLength", 14);
|
||||
|
||||
b.Property<string>("WebSite");
|
||||
|
||||
b.HasKey("PerformerId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Workflow.UserActivity", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("DoesCode");
|
||||
|
||||
b.Property<string>("UserId");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Market.Product", b =>
|
||||
{
|
||||
b.HasBaseType("Yavsc.Models.Market.BaseProduct");
|
||||
|
||||
b.Property<decimal>("Depth");
|
||||
|
||||
b.Property<decimal>("Height");
|
||||
|
||||
b.Property<decimal?>("Price");
|
||||
|
||||
b.Property<decimal>("Weight");
|
||||
|
||||
b.Property<decimal>("Width");
|
||||
|
||||
b.HasAnnotation("Relational:DiscriminatorValue", "Product");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityRoleClaim<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNet.Identity.EntityFramework.IdentityRole")
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserClaim<string>", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserLogin<string>", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserRole<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNet.Identity.EntityFramework.IdentityRole")
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId");
|
||||
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Access.BlackListed", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("OwnerId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.AccountBalance", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithOne()
|
||||
.HasForeignKey("Yavsc.Models.AccountBalance", "UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Activity", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Activity")
|
||||
.WithMany()
|
||||
.HasForeignKey("ParentCode");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.ApplicationUser", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Model.Bank.BankIdentity")
|
||||
.WithMany()
|
||||
.HasForeignKey("BankInfoId");
|
||||
|
||||
b.HasOne("Yavsc.Location")
|
||||
.WithMany()
|
||||
.HasForeignKey("PostalAddressId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.BalanceImpact", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.AccountBalance")
|
||||
.WithMany()
|
||||
.HasForeignKey("BalanceId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Billing.CommandLine", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Market.BaseProduct")
|
||||
.WithMany()
|
||||
.HasForeignKey("ArticleId");
|
||||
|
||||
b.HasOne("Yavsc.Models.Billing.Estimate")
|
||||
.WithMany()
|
||||
.HasForeignKey("EstimateId");
|
||||
|
||||
b.HasOne("Yavsc.Models.Billing.EstimateTemplate")
|
||||
.WithMany()
|
||||
.HasForeignKey("EstimateTemplateId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Billing.Estimate", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Booking.BookQuery")
|
||||
.WithMany()
|
||||
.HasForeignKey("CommandId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Blog", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("AuthorId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Booking.BookQuery", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("ClientId");
|
||||
|
||||
b.HasOne("Yavsc.Location")
|
||||
.WithMany()
|
||||
.HasForeignKey("LocationId");
|
||||
|
||||
b.HasOne("Yavsc.Models.Relationship.LocationType")
|
||||
.WithMany()
|
||||
.HasForeignKey("LocationTypeId");
|
||||
|
||||
b.HasOne("Yavsc.Models.Workflow.PerformerProfile")
|
||||
.WithMany()
|
||||
.HasForeignKey("PerformerId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Booking.MusicalPreference", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Workflow.PerformerProfile")
|
||||
.WithMany()
|
||||
.HasForeignKey("OwnerProfileId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Chat.Connection", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("ApplicationUserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Circle", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("ApplicationUserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.CircleMember", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Circle")
|
||||
.WithMany()
|
||||
.HasForeignKey("CircleId");
|
||||
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("MemberId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Contact", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("ApplicationUserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Identity.GoogleCloudMobileDeclaration", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("DeviceOwnerId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Market.Service", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Activity")
|
||||
.WithMany()
|
||||
.HasForeignKey("ContextId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Messaging.ClientProviderInfo", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Location")
|
||||
.WithMany()
|
||||
.HasForeignKey("BillingAddressId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.PostTag", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Blog")
|
||||
.WithMany()
|
||||
.HasForeignKey("PostId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Workflow.PerformerProfile", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Market.Service")
|
||||
.WithMany()
|
||||
.HasForeignKey("OfferId");
|
||||
|
||||
b.HasOne("Yavsc.Location")
|
||||
.WithMany()
|
||||
.HasForeignKey("OrganizationAddressId");
|
||||
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("PerformerId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Workflow.UserActivity", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Activity")
|
||||
.WithMany()
|
||||
.HasForeignKey("DoesCode");
|
||||
|
||||
b.HasOne("Yavsc.Models.Workflow.PerformerProfile")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,302 @@
|
||||
|
||||
using Microsoft.Data.Entity.Migrations;
|
||||
|
||||
namespace Yavsc.Migrations
|
||||
{
|
||||
public partial class activityRate : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId", table: "AspNetRoleClaims");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId", table: "AspNetUserClaims");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId", table: "AspNetUserLogins");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_IdentityRole_RoleId", table: "AspNetUserRoles");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_ApplicationUser_UserId", table: "AspNetUserRoles");
|
||||
migrationBuilder.DropForeignKey(name: "FK_AccountBalance_ApplicationUser_UserId", table: "AccountBalance");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BalanceImpact_AccountBalance_BalanceId", table: "BalanceImpact");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CommandLine_Estimate_EstimateId", table: "CommandLine");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BookQuery_ApplicationUser_ClientId", table: "BookQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BookQuery_PerformerProfile_PerformerId", table: "BookQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CircleMember_Circle_CircleId", table: "CircleMember");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CircleMember_ApplicationUser_MemberId", table: "CircleMember");
|
||||
migrationBuilder.DropForeignKey(name: "FK_PostTag_Blog_PostId", table: "PostTag");
|
||||
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_Activity_ActivityCode", table: "PerformerProfile");
|
||||
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_Location_OrganizationAddressId", table: "PerformerProfile");
|
||||
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_ApplicationUser_PerformerId", table: "PerformerProfile");
|
||||
migrationBuilder.DropColumn(name: "ActivityCode", table: "PerformerProfile");
|
||||
migrationBuilder.CreateTable(
|
||||
name: "UserActivity",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<long>(nullable: false)
|
||||
.Annotation("Npgsql:Serial", true),
|
||||
DoesCode = table.Column<string>(nullable: true),
|
||||
UserId = table.Column<string>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_UserActivity", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_UserActivity_Activity_DoesCode",
|
||||
column: x => x.DoesCode,
|
||||
principalTable: "Activity",
|
||||
principalColumn: "Code",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_UserActivity_PerformerProfile_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "PerformerProfile",
|
||||
principalColumn: "PerformerId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "Rate",
|
||||
table: "Activity",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId",
|
||||
table: "AspNetRoleClaims",
|
||||
column: "RoleId",
|
||||
principalTable: "AspNetRoles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserClaims",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserLogins",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserRole<string>_IdentityRole_RoleId",
|
||||
table: "AspNetUserRoles",
|
||||
column: "RoleId",
|
||||
principalTable: "AspNetRoles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserRole<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserRoles",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_AccountBalance_ApplicationUser_UserId",
|
||||
table: "AccountBalance",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BalanceImpact_AccountBalance_BalanceId",
|
||||
table: "BalanceImpact",
|
||||
column: "BalanceId",
|
||||
principalTable: "AccountBalance",
|
||||
principalColumn: "UserId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CommandLine_Estimate_EstimateId",
|
||||
table: "CommandLine",
|
||||
column: "EstimateId",
|
||||
principalTable: "Estimate",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BookQuery_ApplicationUser_ClientId",
|
||||
table: "BookQuery",
|
||||
column: "ClientId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BookQuery_PerformerProfile_PerformerId",
|
||||
table: "BookQuery",
|
||||
column: "PerformerId",
|
||||
principalTable: "PerformerProfile",
|
||||
principalColumn: "PerformerId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CircleMember_Circle_CircleId",
|
||||
table: "CircleMember",
|
||||
column: "CircleId",
|
||||
principalTable: "Circle",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CircleMember_ApplicationUser_MemberId",
|
||||
table: "CircleMember",
|
||||
column: "MemberId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PostTag_Blog_PostId",
|
||||
table: "PostTag",
|
||||
column: "PostId",
|
||||
principalTable: "Blog",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PerformerProfile_Location_OrganizationAddressId",
|
||||
table: "PerformerProfile",
|
||||
column: "OrganizationAddressId",
|
||||
principalTable: "Location",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PerformerProfile_ApplicationUser_PerformerId",
|
||||
table: "PerformerProfile",
|
||||
column: "PerformerId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId", table: "AspNetRoleClaims");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId", table: "AspNetUserClaims");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId", table: "AspNetUserLogins");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_IdentityRole_RoleId", table: "AspNetUserRoles");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_ApplicationUser_UserId", table: "AspNetUserRoles");
|
||||
migrationBuilder.DropForeignKey(name: "FK_AccountBalance_ApplicationUser_UserId", table: "AccountBalance");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BalanceImpact_AccountBalance_BalanceId", table: "BalanceImpact");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CommandLine_Estimate_EstimateId", table: "CommandLine");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BookQuery_ApplicationUser_ClientId", table: "BookQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BookQuery_PerformerProfile_PerformerId", table: "BookQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CircleMember_Circle_CircleId", table: "CircleMember");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CircleMember_ApplicationUser_MemberId", table: "CircleMember");
|
||||
migrationBuilder.DropForeignKey(name: "FK_PostTag_Blog_PostId", table: "PostTag");
|
||||
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_Location_OrganizationAddressId", table: "PerformerProfile");
|
||||
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_ApplicationUser_PerformerId", table: "PerformerProfile");
|
||||
migrationBuilder.DropColumn(name: "Rate", table: "Activity");
|
||||
migrationBuilder.DropTable("UserActivity");
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "ActivityCode",
|
||||
table: "PerformerProfile",
|
||||
nullable: false,
|
||||
defaultValue: "");
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId",
|
||||
table: "AspNetRoleClaims",
|
||||
column: "RoleId",
|
||||
principalTable: "AspNetRoles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserClaims",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserLogins",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserRole<string>_IdentityRole_RoleId",
|
||||
table: "AspNetUserRoles",
|
||||
column: "RoleId",
|
||||
principalTable: "AspNetRoles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserRole<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserRoles",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_AccountBalance_ApplicationUser_UserId",
|
||||
table: "AccountBalance",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BalanceImpact_AccountBalance_BalanceId",
|
||||
table: "BalanceImpact",
|
||||
column: "BalanceId",
|
||||
principalTable: "AccountBalance",
|
||||
principalColumn: "UserId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CommandLine_Estimate_EstimateId",
|
||||
table: "CommandLine",
|
||||
column: "EstimateId",
|
||||
principalTable: "Estimate",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BookQuery_ApplicationUser_ClientId",
|
||||
table: "BookQuery",
|
||||
column: "ClientId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BookQuery_PerformerProfile_PerformerId",
|
||||
table: "BookQuery",
|
||||
column: "PerformerId",
|
||||
principalTable: "PerformerProfile",
|
||||
principalColumn: "PerformerId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CircleMember_Circle_CircleId",
|
||||
table: "CircleMember",
|
||||
column: "CircleId",
|
||||
principalTable: "Circle",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CircleMember_ApplicationUser_MemberId",
|
||||
table: "CircleMember",
|
||||
column: "MemberId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PostTag_Blog_PostId",
|
||||
table: "PostTag",
|
||||
column: "PostId",
|
||||
principalTable: "Blog",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PerformerProfile_Activity_ActivityCode",
|
||||
table: "PerformerProfile",
|
||||
column: "ActivityCode",
|
||||
principalTable: "Activity",
|
||||
principalColumn: "Code",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PerformerProfile_Location_OrganizationAddressId",
|
||||
table: "PerformerProfile",
|
||||
column: "OrganizationAddressId",
|
||||
principalTable: "Location",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PerformerProfile_ApplicationUser_PerformerId",
|
||||
table: "PerformerProfile",
|
||||
column: "PerformerId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,946 @@
|
||||
using System;
|
||||
using Microsoft.Data.Entity;
|
||||
using Microsoft.Data.Entity.Infrastructure;
|
||||
using Microsoft.Data.Entity.Migrations;
|
||||
using Yavsc.Models;
|
||||
|
||||
namespace Yavsc.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationDbContext))]
|
||||
[Migration("20170106235954_weight")]
|
||||
partial class weight
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "7.0.0-rc1-16348");
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityRole", b =>
|
||||
{
|
||||
b.Property<string>("Id");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken();
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasAnnotation("MaxLength", 256);
|
||||
|
||||
b.Property<string>("NormalizedName")
|
||||
.HasAnnotation("MaxLength", 256);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedName")
|
||||
.HasAnnotation("Relational:Name", "RoleNameIndex");
|
||||
|
||||
b.HasAnnotation("Relational:TableName", "AspNetRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityRoleClaim<string>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("ClaimType");
|
||||
|
||||
b.Property<string>("ClaimValue");
|
||||
|
||||
b.Property<string>("RoleId")
|
||||
.IsRequired();
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasAnnotation("Relational:TableName", "AspNetRoleClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserClaim<string>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("ClaimType");
|
||||
|
||||
b.Property<string>("ClaimValue");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.IsRequired();
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasAnnotation("Relational:TableName", "AspNetUserClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserLogin<string>", b =>
|
||||
{
|
||||
b.Property<string>("LoginProvider");
|
||||
|
||||
b.Property<string>("ProviderKey");
|
||||
|
||||
b.Property<string>("ProviderDisplayName");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.IsRequired();
|
||||
|
||||
b.HasKey("LoginProvider", "ProviderKey");
|
||||
|
||||
b.HasAnnotation("Relational:TableName", "AspNetUserLogins");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserRole<string>", b =>
|
||||
{
|
||||
b.Property<string>("UserId");
|
||||
|
||||
b.Property<string>("RoleId");
|
||||
|
||||
b.HasKey("UserId", "RoleId");
|
||||
|
||||
b.HasAnnotation("Relational:TableName", "AspNetUserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Location", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Address")
|
||||
.IsRequired()
|
||||
.HasAnnotation("MaxLength", 512);
|
||||
|
||||
b.Property<double>("Latitude");
|
||||
|
||||
b.Property<double>("Longitude");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Model.Bank.BankIdentity", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("AccountNumber")
|
||||
.HasAnnotation("MaxLength", 15);
|
||||
|
||||
b.Property<string>("BIC")
|
||||
.HasAnnotation("MaxLength", 15);
|
||||
|
||||
b.Property<string>("BankCode")
|
||||
.HasAnnotation("MaxLength", 5);
|
||||
|
||||
b.Property<int>("BankedKey");
|
||||
|
||||
b.Property<string>("IBAN")
|
||||
.HasAnnotation("MaxLength", 33);
|
||||
|
||||
b.Property<string>("WicketCode")
|
||||
.HasAnnotation("MaxLength", 5);
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Access.BlackListed", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("OwnerId");
|
||||
|
||||
b.Property<string>("UserId");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.AccountBalance", b =>
|
||||
{
|
||||
b.Property<string>("UserId");
|
||||
|
||||
b.Property<long>("ContactCredits");
|
||||
|
||||
b.Property<decimal>("Credits");
|
||||
|
||||
b.HasKey("UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Activity", b =>
|
||||
{
|
||||
b.Property<string>("Code")
|
||||
.HasAnnotation("MaxLength", 512);
|
||||
|
||||
b.Property<string>("ActorDenomination");
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
b.Property<string>("ModeratorGroupName");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasAnnotation("MaxLength", 512);
|
||||
|
||||
b.Property<string>("ParentCode")
|
||||
.HasAnnotation("MaxLength", 512);
|
||||
|
||||
b.Property<string>("Photo");
|
||||
|
||||
b.Property<int>("Rate");
|
||||
|
||||
b.HasKey("Code");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.ApplicationUser", b =>
|
||||
{
|
||||
b.Property<string>("Id");
|
||||
|
||||
b.Property<int>("AccessFailedCount");
|
||||
|
||||
b.Property<string>("Avatar")
|
||||
.HasAnnotation("MaxLength", 512);
|
||||
|
||||
b.Property<long?>("BankInfoId");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken();
|
||||
|
||||
b.Property<string>("DedicatedGoogleCalendar");
|
||||
|
||||
b.Property<long>("DiskQuota");
|
||||
|
||||
b.Property<long>("DiskUsage");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasAnnotation("MaxLength", 256);
|
||||
|
||||
b.Property<bool>("EmailConfirmed");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.HasAnnotation("MaxLength", 512);
|
||||
|
||||
b.Property<bool>("LockoutEnabled");
|
||||
|
||||
b.Property<DateTimeOffset?>("LockoutEnd");
|
||||
|
||||
b.Property<string>("NormalizedEmail")
|
||||
.HasAnnotation("MaxLength", 256);
|
||||
|
||||
b.Property<string>("NormalizedUserName")
|
||||
.HasAnnotation("MaxLength", 256);
|
||||
|
||||
b.Property<string>("PasswordHash");
|
||||
|
||||
b.Property<string>("PhoneNumber");
|
||||
|
||||
b.Property<bool>("PhoneNumberConfirmed");
|
||||
|
||||
b.Property<long?>("PostalAddressId");
|
||||
|
||||
b.Property<string>("SecurityStamp");
|
||||
|
||||
b.Property<bool>("TwoFactorEnabled");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasAnnotation("MaxLength", 256);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedEmail")
|
||||
.HasAnnotation("Relational:Name", "EmailIndex");
|
||||
|
||||
b.HasIndex("NormalizedUserName")
|
||||
.HasAnnotation("Relational:Name", "UserNameIndex");
|
||||
|
||||
b.HasAnnotation("Relational:TableName", "AspNetUsers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Auth.Client", b =>
|
||||
{
|
||||
b.Property<string>("Id");
|
||||
|
||||
b.Property<bool>("Active");
|
||||
|
||||
b.Property<string>("DisplayName");
|
||||
|
||||
b.Property<string>("LogoutRedirectUri")
|
||||
.HasAnnotation("MaxLength", 100);
|
||||
|
||||
b.Property<string>("RedirectUri");
|
||||
|
||||
b.Property<int>("RefreshTokenLifeTime");
|
||||
|
||||
b.Property<string>("Secret");
|
||||
|
||||
b.Property<int>("Type");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Auth.RefreshToken", b =>
|
||||
{
|
||||
b.Property<string>("Id");
|
||||
|
||||
b.Property<string>("ClientId")
|
||||
.IsRequired()
|
||||
.HasAnnotation("MaxLength", 50);
|
||||
|
||||
b.Property<DateTime>("ExpiresUtc");
|
||||
|
||||
b.Property<DateTime>("IssuedUtc");
|
||||
|
||||
b.Property<string>("ProtectedTicket")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<string>("Subject")
|
||||
.IsRequired()
|
||||
.HasAnnotation("MaxLength", 50);
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.BalanceImpact", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("BalanceId")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<DateTime>("ExecDate");
|
||||
|
||||
b.Property<decimal>("Impact");
|
||||
|
||||
b.Property<string>("Reason")
|
||||
.IsRequired();
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Billing.CommandLine", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<long?>("ArticleId");
|
||||
|
||||
b.Property<int>("Count");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasAnnotation("MaxLength", 512);
|
||||
|
||||
b.Property<long>("EstimateId");
|
||||
|
||||
b.Property<long?>("EstimateTemplateId");
|
||||
|
||||
b.Property<decimal>("UnitaryCost");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Billing.Estimate", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("AttachedFilesString");
|
||||
|
||||
b.Property<string>("AttachedGraphicsString");
|
||||
|
||||
b.Property<string>("ClientId")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<DateTime>("ClientValidationDate");
|
||||
|
||||
b.Property<long?>("CommandId");
|
||||
|
||||
b.Property<string>("CommandType");
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
b.Property<string>("OwnerId")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<DateTime>("ProviderValidationDate");
|
||||
|
||||
b.Property<string>("Title");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Billing.EstimateTemplate", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
b.Property<string>("OwnerId")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<string>("Title");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Billing.ExceptionSIREN", b =>
|
||||
{
|
||||
b.Property<string>("SIREN");
|
||||
|
||||
b.HasKey("SIREN");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Blog", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("AuthorId");
|
||||
|
||||
b.Property<string>("Content");
|
||||
|
||||
b.Property<DateTime>("Modified");
|
||||
|
||||
b.Property<string>("Photo");
|
||||
|
||||
b.Property<DateTime>("Posted")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("Relational:GeneratedValueSql", "LOCALTIMESTAMP");
|
||||
|
||||
b.Property<int>("Rate");
|
||||
|
||||
b.Property<string>("Title");
|
||||
|
||||
b.Property<bool>("Visible");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Booking.BookQuery", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("ClientId")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("Relational:GeneratedValueSql", "LOCALTIMESTAMP");
|
||||
|
||||
b.Property<DateTime>("EventDate");
|
||||
|
||||
b.Property<long?>("LocationId");
|
||||
|
||||
b.Property<long?>("LocationTypeId");
|
||||
|
||||
b.Property<string>("PerformerId")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<decimal?>("Previsional");
|
||||
|
||||
b.Property<string>("Reason");
|
||||
|
||||
b.Property<DateTime?>("ValidationDate");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Booking.Instrument", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasAnnotation("MaxLength", 255);
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Booking.MusicalPreference", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasAnnotation("MaxLength", 255);
|
||||
|
||||
b.Property<string>("OwnerProfileId");
|
||||
|
||||
b.Property<int>("Rate");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Booking.MusicalTendency", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasAnnotation("MaxLength", 255);
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Chat.Connection", b =>
|
||||
{
|
||||
b.Property<string>("ConnectionId");
|
||||
|
||||
b.Property<string>("ApplicationUserId");
|
||||
|
||||
b.Property<bool>("Connected");
|
||||
|
||||
b.Property<string>("UserAgent");
|
||||
|
||||
b.HasKey("ConnectionId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Circle", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("ApplicationUserId");
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<string>("OwnerId");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.CircleMember", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<long>("CircleId");
|
||||
|
||||
b.Property<string>("MemberId")
|
||||
.IsRequired();
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Contact", b =>
|
||||
{
|
||||
b.Property<string>("OwnerId");
|
||||
|
||||
b.Property<string>("UserId");
|
||||
|
||||
b.Property<string>("ApplicationUserId");
|
||||
|
||||
b.HasKey("OwnerId", "UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Identity.GoogleCloudMobileDeclaration", b =>
|
||||
{
|
||||
b.Property<string>("DeviceId");
|
||||
|
||||
b.Property<DateTime>("DeclarationDate")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("Relational:GeneratedValueSql", "LOCALTIMESTAMP");
|
||||
|
||||
b.Property<string>("DeviceOwnerId");
|
||||
|
||||
b.Property<string>("GCMRegistrationId")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<string>("Model");
|
||||
|
||||
b.Property<string>("Platform");
|
||||
|
||||
b.Property<string>("Version");
|
||||
|
||||
b.HasKey("DeviceId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Market.BaseProduct", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
b.Property<string>("Discriminator")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<bool>("Public");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasAnnotation("Relational:DiscriminatorProperty", "Discriminator");
|
||||
|
||||
b.HasAnnotation("Relational:DiscriminatorValue", "BaseProduct");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Market.Service", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("ContextId");
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<bool>("Public");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Messaging.ClientProviderInfo", b =>
|
||||
{
|
||||
b.Property<string>("UserId");
|
||||
|
||||
b.Property<string>("Avatar");
|
||||
|
||||
b.Property<long?>("BillingAddressId");
|
||||
|
||||
b.Property<string>("EMail");
|
||||
|
||||
b.Property<string>("Phone");
|
||||
|
||||
b.Property<string>("UserName");
|
||||
|
||||
b.HasKey("UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.OAuth.OAuth2Tokens", b =>
|
||||
{
|
||||
b.Property<string>("UserId");
|
||||
|
||||
b.Property<string>("AccessToken");
|
||||
|
||||
b.Property<DateTime>("Expiration");
|
||||
|
||||
b.Property<string>("ExpiresIn");
|
||||
|
||||
b.Property<string>("RefreshToken");
|
||||
|
||||
b.Property<string>("TokenType");
|
||||
|
||||
b.HasKey("UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.PostTag", b =>
|
||||
{
|
||||
b.Property<long>("PostId");
|
||||
|
||||
b.Property<long>("TagId");
|
||||
|
||||
b.HasKey("PostId", "TagId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Relationship.LocationType", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Skill", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<int>("Rate");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Tag", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired();
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Workflow.PerformerProfile", b =>
|
||||
{
|
||||
b.Property<string>("PerformerId");
|
||||
|
||||
b.Property<bool>("AcceptGeoLocalization");
|
||||
|
||||
b.Property<bool>("AcceptNotifications");
|
||||
|
||||
b.Property<bool>("AcceptPublicContact");
|
||||
|
||||
b.Property<bool>("Active");
|
||||
|
||||
b.Property<int?>("MaxDailyCost");
|
||||
|
||||
b.Property<int?>("MinDailyCost");
|
||||
|
||||
b.Property<long?>("OfferId");
|
||||
|
||||
b.Property<long>("OrganizationAddressId");
|
||||
|
||||
b.Property<int>("Rate");
|
||||
|
||||
b.Property<string>("SIREN")
|
||||
.IsRequired()
|
||||
.HasAnnotation("MaxLength", 14);
|
||||
|
||||
b.Property<string>("WebSite");
|
||||
|
||||
b.HasKey("PerformerId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Workflow.UserActivity", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("DoesCode");
|
||||
|
||||
b.Property<string>("UserId");
|
||||
|
||||
b.Property<int>("Weight");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Market.Product", b =>
|
||||
{
|
||||
b.HasBaseType("Yavsc.Models.Market.BaseProduct");
|
||||
|
||||
b.Property<decimal>("Depth");
|
||||
|
||||
b.Property<decimal>("Height");
|
||||
|
||||
b.Property<decimal?>("Price");
|
||||
|
||||
b.Property<decimal>("Weight");
|
||||
|
||||
b.Property<decimal>("Width");
|
||||
|
||||
b.HasAnnotation("Relational:DiscriminatorValue", "Product");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityRoleClaim<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNet.Identity.EntityFramework.IdentityRole")
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserClaim<string>", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserLogin<string>", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserRole<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNet.Identity.EntityFramework.IdentityRole")
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId");
|
||||
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Access.BlackListed", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("OwnerId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.AccountBalance", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithOne()
|
||||
.HasForeignKey("Yavsc.Models.AccountBalance", "UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Activity", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Activity")
|
||||
.WithMany()
|
||||
.HasForeignKey("ParentCode");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.ApplicationUser", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Model.Bank.BankIdentity")
|
||||
.WithMany()
|
||||
.HasForeignKey("BankInfoId");
|
||||
|
||||
b.HasOne("Yavsc.Location")
|
||||
.WithMany()
|
||||
.HasForeignKey("PostalAddressId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.BalanceImpact", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.AccountBalance")
|
||||
.WithMany()
|
||||
.HasForeignKey("BalanceId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Billing.CommandLine", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Market.BaseProduct")
|
||||
.WithMany()
|
||||
.HasForeignKey("ArticleId");
|
||||
|
||||
b.HasOne("Yavsc.Models.Billing.Estimate")
|
||||
.WithMany()
|
||||
.HasForeignKey("EstimateId");
|
||||
|
||||
b.HasOne("Yavsc.Models.Billing.EstimateTemplate")
|
||||
.WithMany()
|
||||
.HasForeignKey("EstimateTemplateId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Billing.Estimate", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Booking.BookQuery")
|
||||
.WithMany()
|
||||
.HasForeignKey("CommandId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Blog", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("AuthorId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Booking.BookQuery", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("ClientId");
|
||||
|
||||
b.HasOne("Yavsc.Location")
|
||||
.WithMany()
|
||||
.HasForeignKey("LocationId");
|
||||
|
||||
b.HasOne("Yavsc.Models.Relationship.LocationType")
|
||||
.WithMany()
|
||||
.HasForeignKey("LocationTypeId");
|
||||
|
||||
b.HasOne("Yavsc.Models.Workflow.PerformerProfile")
|
||||
.WithMany()
|
||||
.HasForeignKey("PerformerId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Booking.MusicalPreference", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Workflow.PerformerProfile")
|
||||
.WithMany()
|
||||
.HasForeignKey("OwnerProfileId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Chat.Connection", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("ApplicationUserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Circle", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("ApplicationUserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.CircleMember", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Circle")
|
||||
.WithMany()
|
||||
.HasForeignKey("CircleId");
|
||||
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("MemberId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Contact", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("ApplicationUserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Identity.GoogleCloudMobileDeclaration", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("DeviceOwnerId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Market.Service", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Activity")
|
||||
.WithMany()
|
||||
.HasForeignKey("ContextId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Messaging.ClientProviderInfo", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Location")
|
||||
.WithMany()
|
||||
.HasForeignKey("BillingAddressId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.PostTag", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Blog")
|
||||
.WithMany()
|
||||
.HasForeignKey("PostId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Workflow.PerformerProfile", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Market.Service")
|
||||
.WithMany()
|
||||
.HasForeignKey("OfferId");
|
||||
|
||||
b.HasOne("Yavsc.Location")
|
||||
.WithMany()
|
||||
.HasForeignKey("OrganizationAddressId");
|
||||
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("PerformerId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Workflow.UserActivity", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Activity")
|
||||
.WithMany()
|
||||
.HasForeignKey("DoesCode");
|
||||
|
||||
b.HasOne("Yavsc.Models.Workflow.PerformerProfile")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,262 @@
|
||||
|
||||
using Microsoft.Data.Entity.Migrations;
|
||||
|
||||
namespace Yavsc.Migrations
|
||||
{
|
||||
public partial class weight : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId", table: "AspNetRoleClaims");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId", table: "AspNetUserClaims");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId", table: "AspNetUserLogins");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_IdentityRole_RoleId", table: "AspNetUserRoles");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_ApplicationUser_UserId", table: "AspNetUserRoles");
|
||||
migrationBuilder.DropForeignKey(name: "FK_AccountBalance_ApplicationUser_UserId", table: "AccountBalance");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BalanceImpact_AccountBalance_BalanceId", table: "BalanceImpact");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CommandLine_Estimate_EstimateId", table: "CommandLine");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BookQuery_ApplicationUser_ClientId", table: "BookQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BookQuery_PerformerProfile_PerformerId", table: "BookQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CircleMember_Circle_CircleId", table: "CircleMember");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CircleMember_ApplicationUser_MemberId", table: "CircleMember");
|
||||
migrationBuilder.DropForeignKey(name: "FK_PostTag_Blog_PostId", table: "PostTag");
|
||||
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_Location_OrganizationAddressId", table: "PerformerProfile");
|
||||
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_ApplicationUser_PerformerId", table: "PerformerProfile");
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "Weight",
|
||||
table: "UserActivity",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId",
|
||||
table: "AspNetRoleClaims",
|
||||
column: "RoleId",
|
||||
principalTable: "AspNetRoles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserClaims",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserLogins",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserRole<string>_IdentityRole_RoleId",
|
||||
table: "AspNetUserRoles",
|
||||
column: "RoleId",
|
||||
principalTable: "AspNetRoles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserRole<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserRoles",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_AccountBalance_ApplicationUser_UserId",
|
||||
table: "AccountBalance",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BalanceImpact_AccountBalance_BalanceId",
|
||||
table: "BalanceImpact",
|
||||
column: "BalanceId",
|
||||
principalTable: "AccountBalance",
|
||||
principalColumn: "UserId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CommandLine_Estimate_EstimateId",
|
||||
table: "CommandLine",
|
||||
column: "EstimateId",
|
||||
principalTable: "Estimate",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BookQuery_ApplicationUser_ClientId",
|
||||
table: "BookQuery",
|
||||
column: "ClientId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BookQuery_PerformerProfile_PerformerId",
|
||||
table: "BookQuery",
|
||||
column: "PerformerId",
|
||||
principalTable: "PerformerProfile",
|
||||
principalColumn: "PerformerId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CircleMember_Circle_CircleId",
|
||||
table: "CircleMember",
|
||||
column: "CircleId",
|
||||
principalTable: "Circle",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CircleMember_ApplicationUser_MemberId",
|
||||
table: "CircleMember",
|
||||
column: "MemberId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PostTag_Blog_PostId",
|
||||
table: "PostTag",
|
||||
column: "PostId",
|
||||
principalTable: "Blog",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PerformerProfile_Location_OrganizationAddressId",
|
||||
table: "PerformerProfile",
|
||||
column: "OrganizationAddressId",
|
||||
principalTable: "Location",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PerformerProfile_ApplicationUser_PerformerId",
|
||||
table: "PerformerProfile",
|
||||
column: "PerformerId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId", table: "AspNetRoleClaims");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId", table: "AspNetUserClaims");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId", table: "AspNetUserLogins");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_IdentityRole_RoleId", table: "AspNetUserRoles");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_ApplicationUser_UserId", table: "AspNetUserRoles");
|
||||
migrationBuilder.DropForeignKey(name: "FK_AccountBalance_ApplicationUser_UserId", table: "AccountBalance");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BalanceImpact_AccountBalance_BalanceId", table: "BalanceImpact");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CommandLine_Estimate_EstimateId", table: "CommandLine");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BookQuery_ApplicationUser_ClientId", table: "BookQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BookQuery_PerformerProfile_PerformerId", table: "BookQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CircleMember_Circle_CircleId", table: "CircleMember");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CircleMember_ApplicationUser_MemberId", table: "CircleMember");
|
||||
migrationBuilder.DropForeignKey(name: "FK_PostTag_Blog_PostId", table: "PostTag");
|
||||
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_Location_OrganizationAddressId", table: "PerformerProfile");
|
||||
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_ApplicationUser_PerformerId", table: "PerformerProfile");
|
||||
migrationBuilder.DropColumn(name: "Weight", table: "UserActivity");
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId",
|
||||
table: "AspNetRoleClaims",
|
||||
column: "RoleId",
|
||||
principalTable: "AspNetRoles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserClaims",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserLogins",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserRole<string>_IdentityRole_RoleId",
|
||||
table: "AspNetUserRoles",
|
||||
column: "RoleId",
|
||||
principalTable: "AspNetRoles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserRole<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserRoles",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_AccountBalance_ApplicationUser_UserId",
|
||||
table: "AccountBalance",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BalanceImpact_AccountBalance_BalanceId",
|
||||
table: "BalanceImpact",
|
||||
column: "BalanceId",
|
||||
principalTable: "AccountBalance",
|
||||
principalColumn: "UserId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CommandLine_Estimate_EstimateId",
|
||||
table: "CommandLine",
|
||||
column: "EstimateId",
|
||||
principalTable: "Estimate",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BookQuery_ApplicationUser_ClientId",
|
||||
table: "BookQuery",
|
||||
column: "ClientId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BookQuery_PerformerProfile_PerformerId",
|
||||
table: "BookQuery",
|
||||
column: "PerformerId",
|
||||
principalTable: "PerformerProfile",
|
||||
principalColumn: "PerformerId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CircleMember_Circle_CircleId",
|
||||
table: "CircleMember",
|
||||
column: "CircleId",
|
||||
principalTable: "Circle",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CircleMember_ApplicationUser_MemberId",
|
||||
table: "CircleMember",
|
||||
column: "MemberId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PostTag_Blog_PostId",
|
||||
table: "PostTag",
|
||||
column: "PostId",
|
||||
principalTable: "Blog",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PerformerProfile_Location_OrganizationAddressId",
|
||||
table: "PerformerProfile",
|
||||
column: "OrganizationAddressId",
|
||||
principalTable: "Location",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PerformerProfile_ApplicationUser_PerformerId",
|
||||
table: "PerformerProfile",
|
||||
column: "PerformerId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,948 @@
|
||||
using System;
|
||||
using Microsoft.Data.Entity;
|
||||
using Microsoft.Data.Entity.Infrastructure;
|
||||
using Microsoft.Data.Entity.Migrations;
|
||||
using Yavsc.Models;
|
||||
|
||||
namespace Yavsc.Migrations
|
||||
{
|
||||
[DbContext(typeof(ApplicationDbContext))]
|
||||
[Migration("20170107004233_userActivitiesValidity")]
|
||||
partial class userActivitiesValidity
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
modelBuilder
|
||||
.HasAnnotation("ProductVersion", "7.0.0-rc1-16348");
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityRole", b =>
|
||||
{
|
||||
b.Property<string>("Id");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken();
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasAnnotation("MaxLength", 256);
|
||||
|
||||
b.Property<string>("NormalizedName")
|
||||
.HasAnnotation("MaxLength", 256);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedName")
|
||||
.HasAnnotation("Relational:Name", "RoleNameIndex");
|
||||
|
||||
b.HasAnnotation("Relational:TableName", "AspNetRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityRoleClaim<string>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("ClaimType");
|
||||
|
||||
b.Property<string>("ClaimValue");
|
||||
|
||||
b.Property<string>("RoleId")
|
||||
.IsRequired();
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasAnnotation("Relational:TableName", "AspNetRoleClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserClaim<string>", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("ClaimType");
|
||||
|
||||
b.Property<string>("ClaimValue");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.IsRequired();
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasAnnotation("Relational:TableName", "AspNetUserClaims");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserLogin<string>", b =>
|
||||
{
|
||||
b.Property<string>("LoginProvider");
|
||||
|
||||
b.Property<string>("ProviderKey");
|
||||
|
||||
b.Property<string>("ProviderDisplayName");
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.IsRequired();
|
||||
|
||||
b.HasKey("LoginProvider", "ProviderKey");
|
||||
|
||||
b.HasAnnotation("Relational:TableName", "AspNetUserLogins");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserRole<string>", b =>
|
||||
{
|
||||
b.Property<string>("UserId");
|
||||
|
||||
b.Property<string>("RoleId");
|
||||
|
||||
b.HasKey("UserId", "RoleId");
|
||||
|
||||
b.HasAnnotation("Relational:TableName", "AspNetUserRoles");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Location", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Address")
|
||||
.IsRequired()
|
||||
.HasAnnotation("MaxLength", 512);
|
||||
|
||||
b.Property<double>("Latitude");
|
||||
|
||||
b.Property<double>("Longitude");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Model.Bank.BankIdentity", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("AccountNumber")
|
||||
.HasAnnotation("MaxLength", 15);
|
||||
|
||||
b.Property<string>("BIC")
|
||||
.HasAnnotation("MaxLength", 15);
|
||||
|
||||
b.Property<string>("BankCode")
|
||||
.HasAnnotation("MaxLength", 5);
|
||||
|
||||
b.Property<int>("BankedKey");
|
||||
|
||||
b.Property<string>("IBAN")
|
||||
.HasAnnotation("MaxLength", 33);
|
||||
|
||||
b.Property<string>("WicketCode")
|
||||
.HasAnnotation("MaxLength", 5);
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Access.BlackListed", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("OwnerId");
|
||||
|
||||
b.Property<string>("UserId");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.AccountBalance", b =>
|
||||
{
|
||||
b.Property<string>("UserId");
|
||||
|
||||
b.Property<long>("ContactCredits");
|
||||
|
||||
b.Property<decimal>("Credits");
|
||||
|
||||
b.HasKey("UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Activity", b =>
|
||||
{
|
||||
b.Property<string>("Code")
|
||||
.HasAnnotation("MaxLength", 512);
|
||||
|
||||
b.Property<string>("ActorDenomination");
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
b.Property<string>("ModeratorGroupName");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasAnnotation("MaxLength", 512);
|
||||
|
||||
b.Property<string>("ParentCode")
|
||||
.HasAnnotation("MaxLength", 512);
|
||||
|
||||
b.Property<string>("Photo");
|
||||
|
||||
b.Property<int>("Rate");
|
||||
|
||||
b.HasKey("Code");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.ApplicationUser", b =>
|
||||
{
|
||||
b.Property<string>("Id");
|
||||
|
||||
b.Property<int>("AccessFailedCount");
|
||||
|
||||
b.Property<string>("Avatar")
|
||||
.HasAnnotation("MaxLength", 512);
|
||||
|
||||
b.Property<long?>("BankInfoId");
|
||||
|
||||
b.Property<string>("ConcurrencyStamp")
|
||||
.IsConcurrencyToken();
|
||||
|
||||
b.Property<string>("DedicatedGoogleCalendar");
|
||||
|
||||
b.Property<long>("DiskQuota");
|
||||
|
||||
b.Property<long>("DiskUsage");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasAnnotation("MaxLength", 256);
|
||||
|
||||
b.Property<bool>("EmailConfirmed");
|
||||
|
||||
b.Property<string>("FullName")
|
||||
.HasAnnotation("MaxLength", 512);
|
||||
|
||||
b.Property<bool>("LockoutEnabled");
|
||||
|
||||
b.Property<DateTimeOffset?>("LockoutEnd");
|
||||
|
||||
b.Property<string>("NormalizedEmail")
|
||||
.HasAnnotation("MaxLength", 256);
|
||||
|
||||
b.Property<string>("NormalizedUserName")
|
||||
.HasAnnotation("MaxLength", 256);
|
||||
|
||||
b.Property<string>("PasswordHash");
|
||||
|
||||
b.Property<string>("PhoneNumber");
|
||||
|
||||
b.Property<bool>("PhoneNumberConfirmed");
|
||||
|
||||
b.Property<long?>("PostalAddressId");
|
||||
|
||||
b.Property<string>("SecurityStamp");
|
||||
|
||||
b.Property<bool>("TwoFactorEnabled");
|
||||
|
||||
b.Property<string>("UserName")
|
||||
.HasAnnotation("MaxLength", 256);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("NormalizedEmail")
|
||||
.HasAnnotation("Relational:Name", "EmailIndex");
|
||||
|
||||
b.HasIndex("NormalizedUserName")
|
||||
.HasAnnotation("Relational:Name", "UserNameIndex");
|
||||
|
||||
b.HasAnnotation("Relational:TableName", "AspNetUsers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Auth.Client", b =>
|
||||
{
|
||||
b.Property<string>("Id");
|
||||
|
||||
b.Property<bool>("Active");
|
||||
|
||||
b.Property<string>("DisplayName");
|
||||
|
||||
b.Property<string>("LogoutRedirectUri")
|
||||
.HasAnnotation("MaxLength", 100);
|
||||
|
||||
b.Property<string>("RedirectUri");
|
||||
|
||||
b.Property<int>("RefreshTokenLifeTime");
|
||||
|
||||
b.Property<string>("Secret");
|
||||
|
||||
b.Property<int>("Type");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Auth.RefreshToken", b =>
|
||||
{
|
||||
b.Property<string>("Id");
|
||||
|
||||
b.Property<string>("ClientId")
|
||||
.IsRequired()
|
||||
.HasAnnotation("MaxLength", 50);
|
||||
|
||||
b.Property<DateTime>("ExpiresUtc");
|
||||
|
||||
b.Property<DateTime>("IssuedUtc");
|
||||
|
||||
b.Property<string>("ProtectedTicket")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<string>("Subject")
|
||||
.IsRequired()
|
||||
.HasAnnotation("MaxLength", 50);
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.BalanceImpact", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("BalanceId")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<DateTime>("ExecDate");
|
||||
|
||||
b.Property<decimal>("Impact");
|
||||
|
||||
b.Property<string>("Reason")
|
||||
.IsRequired();
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Billing.CommandLine", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<long?>("ArticleId");
|
||||
|
||||
b.Property<int>("Count");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.IsRequired()
|
||||
.HasAnnotation("MaxLength", 512);
|
||||
|
||||
b.Property<long>("EstimateId");
|
||||
|
||||
b.Property<long?>("EstimateTemplateId");
|
||||
|
||||
b.Property<decimal>("UnitaryCost");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Billing.Estimate", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("AttachedFilesString");
|
||||
|
||||
b.Property<string>("AttachedGraphicsString");
|
||||
|
||||
b.Property<string>("ClientId")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<DateTime>("ClientValidationDate");
|
||||
|
||||
b.Property<long?>("CommandId");
|
||||
|
||||
b.Property<string>("CommandType");
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
b.Property<string>("OwnerId")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<DateTime>("ProviderValidationDate");
|
||||
|
||||
b.Property<string>("Title");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Billing.EstimateTemplate", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
b.Property<string>("OwnerId")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<string>("Title");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Billing.ExceptionSIREN", b =>
|
||||
{
|
||||
b.Property<string>("SIREN");
|
||||
|
||||
b.HasKey("SIREN");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Blog", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("AuthorId");
|
||||
|
||||
b.Property<string>("Content");
|
||||
|
||||
b.Property<DateTime>("Modified");
|
||||
|
||||
b.Property<string>("Photo");
|
||||
|
||||
b.Property<DateTime>("Posted")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("Relational:GeneratedValueSql", "LOCALTIMESTAMP");
|
||||
|
||||
b.Property<int>("Rate");
|
||||
|
||||
b.Property<string>("Title");
|
||||
|
||||
b.Property<bool>("Visible");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Booking.BookQuery", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("ClientId")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<DateTime>("CreationDate")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("Relational:GeneratedValueSql", "LOCALTIMESTAMP");
|
||||
|
||||
b.Property<DateTime>("EventDate");
|
||||
|
||||
b.Property<long?>("LocationId");
|
||||
|
||||
b.Property<long?>("LocationTypeId");
|
||||
|
||||
b.Property<string>("PerformerId")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<decimal?>("Previsional");
|
||||
|
||||
b.Property<string>("Reason");
|
||||
|
||||
b.Property<DateTime?>("ValidationDate");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Booking.Instrument", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasAnnotation("MaxLength", 255);
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Booking.MusicalPreference", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasAnnotation("MaxLength", 255);
|
||||
|
||||
b.Property<string>("OwnerProfileId");
|
||||
|
||||
b.Property<int>("Rate");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Booking.MusicalTendency", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasAnnotation("MaxLength", 255);
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Chat.Connection", b =>
|
||||
{
|
||||
b.Property<string>("ConnectionId");
|
||||
|
||||
b.Property<string>("ApplicationUserId");
|
||||
|
||||
b.Property<bool>("Connected");
|
||||
|
||||
b.Property<string>("UserAgent");
|
||||
|
||||
b.HasKey("ConnectionId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Circle", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("ApplicationUserId");
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<string>("OwnerId");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.CircleMember", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<long>("CircleId");
|
||||
|
||||
b.Property<string>("MemberId")
|
||||
.IsRequired();
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Contact", b =>
|
||||
{
|
||||
b.Property<string>("OwnerId");
|
||||
|
||||
b.Property<string>("UserId");
|
||||
|
||||
b.Property<string>("ApplicationUserId");
|
||||
|
||||
b.HasKey("OwnerId", "UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Identity.GoogleCloudMobileDeclaration", b =>
|
||||
{
|
||||
b.Property<string>("DeviceId");
|
||||
|
||||
b.Property<DateTime>("DeclarationDate")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasAnnotation("Relational:GeneratedValueSql", "LOCALTIMESTAMP");
|
||||
|
||||
b.Property<string>("DeviceOwnerId");
|
||||
|
||||
b.Property<string>("GCMRegistrationId")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<string>("Model");
|
||||
|
||||
b.Property<string>("Platform");
|
||||
|
||||
b.Property<string>("Version");
|
||||
|
||||
b.HasKey("DeviceId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Market.BaseProduct", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
b.Property<string>("Discriminator")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<bool>("Public");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasAnnotation("Relational:DiscriminatorProperty", "Discriminator");
|
||||
|
||||
b.HasAnnotation("Relational:DiscriminatorValue", "BaseProduct");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Market.Service", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("ContextId");
|
||||
|
||||
b.Property<string>("Description");
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<bool>("Public");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Messaging.ClientProviderInfo", b =>
|
||||
{
|
||||
b.Property<string>("UserId");
|
||||
|
||||
b.Property<string>("Avatar");
|
||||
|
||||
b.Property<long?>("BillingAddressId");
|
||||
|
||||
b.Property<string>("EMail");
|
||||
|
||||
b.Property<string>("Phone");
|
||||
|
||||
b.Property<string>("UserName");
|
||||
|
||||
b.HasKey("UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.OAuth.OAuth2Tokens", b =>
|
||||
{
|
||||
b.Property<string>("UserId");
|
||||
|
||||
b.Property<string>("AccessToken");
|
||||
|
||||
b.Property<DateTime>("Expiration");
|
||||
|
||||
b.Property<string>("ExpiresIn");
|
||||
|
||||
b.Property<string>("RefreshToken");
|
||||
|
||||
b.Property<string>("TokenType");
|
||||
|
||||
b.HasKey("UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.PostTag", b =>
|
||||
{
|
||||
b.Property<long>("PostId");
|
||||
|
||||
b.Property<long>("TagId");
|
||||
|
||||
b.HasKey("PostId", "TagId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Relationship.LocationType", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Skill", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.Property<int>("Rate");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Tag", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired();
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Workflow.PerformerProfile", b =>
|
||||
{
|
||||
b.Property<string>("PerformerId");
|
||||
|
||||
b.Property<bool>("AcceptGeoLocalization");
|
||||
|
||||
b.Property<bool>("AcceptNotifications");
|
||||
|
||||
b.Property<bool>("AcceptPublicContact");
|
||||
|
||||
b.Property<bool>("Active");
|
||||
|
||||
b.Property<int?>("MaxDailyCost");
|
||||
|
||||
b.Property<int?>("MinDailyCost");
|
||||
|
||||
b.Property<long?>("OfferId");
|
||||
|
||||
b.Property<long>("OrganizationAddressId");
|
||||
|
||||
b.Property<int>("Rate");
|
||||
|
||||
b.Property<string>("SIREN")
|
||||
.IsRequired()
|
||||
.HasAnnotation("MaxLength", 14);
|
||||
|
||||
b.Property<string>("WebSite");
|
||||
|
||||
b.HasKey("PerformerId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Workflow.UserActivity", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("DoesCode")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<string>("UserId")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<int>("Weight");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Market.Product", b =>
|
||||
{
|
||||
b.HasBaseType("Yavsc.Models.Market.BaseProduct");
|
||||
|
||||
b.Property<decimal>("Depth");
|
||||
|
||||
b.Property<decimal>("Height");
|
||||
|
||||
b.Property<decimal?>("Price");
|
||||
|
||||
b.Property<decimal>("Weight");
|
||||
|
||||
b.Property<decimal>("Width");
|
||||
|
||||
b.HasAnnotation("Relational:DiscriminatorValue", "Product");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityRoleClaim<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNet.Identity.EntityFramework.IdentityRole")
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserClaim<string>", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserLogin<string>", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityUserRole<string>", b =>
|
||||
{
|
||||
b.HasOne("Microsoft.AspNet.Identity.EntityFramework.IdentityRole")
|
||||
.WithMany()
|
||||
.HasForeignKey("RoleId");
|
||||
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Access.BlackListed", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("OwnerId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.AccountBalance", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithOne()
|
||||
.HasForeignKey("Yavsc.Models.AccountBalance", "UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Activity", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Activity")
|
||||
.WithMany()
|
||||
.HasForeignKey("ParentCode");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.ApplicationUser", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Model.Bank.BankIdentity")
|
||||
.WithMany()
|
||||
.HasForeignKey("BankInfoId");
|
||||
|
||||
b.HasOne("Yavsc.Location")
|
||||
.WithMany()
|
||||
.HasForeignKey("PostalAddressId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.BalanceImpact", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.AccountBalance")
|
||||
.WithMany()
|
||||
.HasForeignKey("BalanceId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Billing.CommandLine", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Market.BaseProduct")
|
||||
.WithMany()
|
||||
.HasForeignKey("ArticleId");
|
||||
|
||||
b.HasOne("Yavsc.Models.Billing.Estimate")
|
||||
.WithMany()
|
||||
.HasForeignKey("EstimateId");
|
||||
|
||||
b.HasOne("Yavsc.Models.Billing.EstimateTemplate")
|
||||
.WithMany()
|
||||
.HasForeignKey("EstimateTemplateId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Billing.Estimate", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Booking.BookQuery")
|
||||
.WithMany()
|
||||
.HasForeignKey("CommandId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Blog", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("AuthorId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Booking.BookQuery", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("ClientId");
|
||||
|
||||
b.HasOne("Yavsc.Location")
|
||||
.WithMany()
|
||||
.HasForeignKey("LocationId");
|
||||
|
||||
b.HasOne("Yavsc.Models.Relationship.LocationType")
|
||||
.WithMany()
|
||||
.HasForeignKey("LocationTypeId");
|
||||
|
||||
b.HasOne("Yavsc.Models.Workflow.PerformerProfile")
|
||||
.WithMany()
|
||||
.HasForeignKey("PerformerId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Booking.MusicalPreference", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Workflow.PerformerProfile")
|
||||
.WithMany()
|
||||
.HasForeignKey("OwnerProfileId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Chat.Connection", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("ApplicationUserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Circle", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("ApplicationUserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.CircleMember", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Circle")
|
||||
.WithMany()
|
||||
.HasForeignKey("CircleId");
|
||||
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("MemberId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Contact", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("ApplicationUserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Identity.GoogleCloudMobileDeclaration", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("DeviceOwnerId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Market.Service", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Activity")
|
||||
.WithMany()
|
||||
.HasForeignKey("ContextId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Messaging.ClientProviderInfo", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Location")
|
||||
.WithMany()
|
||||
.HasForeignKey("BillingAddressId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.PostTag", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Blog")
|
||||
.WithMany()
|
||||
.HasForeignKey("PostId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Workflow.PerformerProfile", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Market.Service")
|
||||
.WithMany()
|
||||
.HasForeignKey("OfferId");
|
||||
|
||||
b.HasOne("Yavsc.Location")
|
||||
.WithMany()
|
||||
.HasForeignKey("OrganizationAddressId");
|
||||
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("PerformerId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Workflow.UserActivity", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Activity")
|
||||
.WithMany()
|
||||
.HasForeignKey("DoesCode");
|
||||
|
||||
b.HasOne("Yavsc.Models.Workflow.PerformerProfile")
|
||||
.WithMany()
|
||||
.HasForeignKey("UserId");
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,304 @@
|
||||
|
||||
using Microsoft.Data.Entity.Migrations;
|
||||
|
||||
namespace Yavsc.Migrations
|
||||
{
|
||||
public partial class userActivitiesValidity : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId", table: "AspNetRoleClaims");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId", table: "AspNetUserClaims");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId", table: "AspNetUserLogins");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_IdentityRole_RoleId", table: "AspNetUserRoles");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_ApplicationUser_UserId", table: "AspNetUserRoles");
|
||||
migrationBuilder.DropForeignKey(name: "FK_AccountBalance_ApplicationUser_UserId", table: "AccountBalance");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BalanceImpact_AccountBalance_BalanceId", table: "BalanceImpact");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CommandLine_Estimate_EstimateId", table: "CommandLine");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BookQuery_ApplicationUser_ClientId", table: "BookQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BookQuery_PerformerProfile_PerformerId", table: "BookQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CircleMember_Circle_CircleId", table: "CircleMember");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CircleMember_ApplicationUser_MemberId", table: "CircleMember");
|
||||
migrationBuilder.DropForeignKey(name: "FK_PostTag_Blog_PostId", table: "PostTag");
|
||||
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_Location_OrganizationAddressId", table: "PerformerProfile");
|
||||
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_ApplicationUser_PerformerId", table: "PerformerProfile");
|
||||
migrationBuilder.DropForeignKey(name: "FK_UserActivity_Activity_DoesCode", table: "UserActivity");
|
||||
migrationBuilder.DropForeignKey(name: "FK_UserActivity_PerformerProfile_UserId", table: "UserActivity");
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "UserId",
|
||||
table: "UserActivity",
|
||||
nullable: false);
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "DoesCode",
|
||||
table: "UserActivity",
|
||||
nullable: false);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId",
|
||||
table: "AspNetRoleClaims",
|
||||
column: "RoleId",
|
||||
principalTable: "AspNetRoles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserClaims",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserLogins",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserRole<string>_IdentityRole_RoleId",
|
||||
table: "AspNetUserRoles",
|
||||
column: "RoleId",
|
||||
principalTable: "AspNetRoles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserRole<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserRoles",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_AccountBalance_ApplicationUser_UserId",
|
||||
table: "AccountBalance",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BalanceImpact_AccountBalance_BalanceId",
|
||||
table: "BalanceImpact",
|
||||
column: "BalanceId",
|
||||
principalTable: "AccountBalance",
|
||||
principalColumn: "UserId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CommandLine_Estimate_EstimateId",
|
||||
table: "CommandLine",
|
||||
column: "EstimateId",
|
||||
principalTable: "Estimate",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BookQuery_ApplicationUser_ClientId",
|
||||
table: "BookQuery",
|
||||
column: "ClientId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BookQuery_PerformerProfile_PerformerId",
|
||||
table: "BookQuery",
|
||||
column: "PerformerId",
|
||||
principalTable: "PerformerProfile",
|
||||
principalColumn: "PerformerId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CircleMember_Circle_CircleId",
|
||||
table: "CircleMember",
|
||||
column: "CircleId",
|
||||
principalTable: "Circle",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CircleMember_ApplicationUser_MemberId",
|
||||
table: "CircleMember",
|
||||
column: "MemberId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PostTag_Blog_PostId",
|
||||
table: "PostTag",
|
||||
column: "PostId",
|
||||
principalTable: "Blog",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PerformerProfile_Location_OrganizationAddressId",
|
||||
table: "PerformerProfile",
|
||||
column: "OrganizationAddressId",
|
||||
principalTable: "Location",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PerformerProfile_ApplicationUser_PerformerId",
|
||||
table: "PerformerProfile",
|
||||
column: "PerformerId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_UserActivity_Activity_DoesCode",
|
||||
table: "UserActivity",
|
||||
column: "DoesCode",
|
||||
principalTable: "Activity",
|
||||
principalColumn: "Code",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_UserActivity_PerformerProfile_UserId",
|
||||
table: "UserActivity",
|
||||
column: "UserId",
|
||||
principalTable: "PerformerProfile",
|
||||
principalColumn: "PerformerId",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId", table: "AspNetRoleClaims");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId", table: "AspNetUserClaims");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId", table: "AspNetUserLogins");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_IdentityRole_RoleId", table: "AspNetUserRoles");
|
||||
migrationBuilder.DropForeignKey(name: "FK_IdentityUserRole<string>_ApplicationUser_UserId", table: "AspNetUserRoles");
|
||||
migrationBuilder.DropForeignKey(name: "FK_AccountBalance_ApplicationUser_UserId", table: "AccountBalance");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BalanceImpact_AccountBalance_BalanceId", table: "BalanceImpact");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CommandLine_Estimate_EstimateId", table: "CommandLine");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BookQuery_ApplicationUser_ClientId", table: "BookQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_BookQuery_PerformerProfile_PerformerId", table: "BookQuery");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CircleMember_Circle_CircleId", table: "CircleMember");
|
||||
migrationBuilder.DropForeignKey(name: "FK_CircleMember_ApplicationUser_MemberId", table: "CircleMember");
|
||||
migrationBuilder.DropForeignKey(name: "FK_PostTag_Blog_PostId", table: "PostTag");
|
||||
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_Location_OrganizationAddressId", table: "PerformerProfile");
|
||||
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_ApplicationUser_PerformerId", table: "PerformerProfile");
|
||||
migrationBuilder.DropForeignKey(name: "FK_UserActivity_Activity_DoesCode", table: "UserActivity");
|
||||
migrationBuilder.DropForeignKey(name: "FK_UserActivity_PerformerProfile_UserId", table: "UserActivity");
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "UserId",
|
||||
table: "UserActivity",
|
||||
nullable: true);
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "DoesCode",
|
||||
table: "UserActivity",
|
||||
nullable: true);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityRoleClaim<string>_IdentityRole_RoleId",
|
||||
table: "AspNetRoleClaims",
|
||||
column: "RoleId",
|
||||
principalTable: "AspNetRoles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserClaim<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserClaims",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserLogin<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserLogins",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserRole<string>_IdentityRole_RoleId",
|
||||
table: "AspNetUserRoles",
|
||||
column: "RoleId",
|
||||
principalTable: "AspNetRoles",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_IdentityUserRole<string>_ApplicationUser_UserId",
|
||||
table: "AspNetUserRoles",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_AccountBalance_ApplicationUser_UserId",
|
||||
table: "AccountBalance",
|
||||
column: "UserId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BalanceImpact_AccountBalance_BalanceId",
|
||||
table: "BalanceImpact",
|
||||
column: "BalanceId",
|
||||
principalTable: "AccountBalance",
|
||||
principalColumn: "UserId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CommandLine_Estimate_EstimateId",
|
||||
table: "CommandLine",
|
||||
column: "EstimateId",
|
||||
principalTable: "Estimate",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BookQuery_ApplicationUser_ClientId",
|
||||
table: "BookQuery",
|
||||
column: "ClientId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_BookQuery_PerformerProfile_PerformerId",
|
||||
table: "BookQuery",
|
||||
column: "PerformerId",
|
||||
principalTable: "PerformerProfile",
|
||||
principalColumn: "PerformerId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CircleMember_Circle_CircleId",
|
||||
table: "CircleMember",
|
||||
column: "CircleId",
|
||||
principalTable: "Circle",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_CircleMember_ApplicationUser_MemberId",
|
||||
table: "CircleMember",
|
||||
column: "MemberId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PostTag_Blog_PostId",
|
||||
table: "PostTag",
|
||||
column: "PostId",
|
||||
principalTable: "Blog",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PerformerProfile_Location_OrganizationAddressId",
|
||||
table: "PerformerProfile",
|
||||
column: "OrganizationAddressId",
|
||||
principalTable: "Location",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_PerformerProfile_ApplicationUser_PerformerId",
|
||||
table: "PerformerProfile",
|
||||
column: "PerformerId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_UserActivity_Activity_DoesCode",
|
||||
table: "UserActivity",
|
||||
column: "DoesCode",
|
||||
principalTable: "Activity",
|
||||
principalColumn: "Code",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_UserActivity_PerformerProfile_UserId",
|
||||
table: "UserActivity",
|
||||
column: "UserId",
|
||||
principalTable: "PerformerProfile",
|
||||
principalColumn: "PerformerId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,26 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Workflow
|
||||
{
|
||||
public class UserActivity
|
||||
{
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
|
||||
[Required]
|
||||
public string UserId { get; set; }
|
||||
|
||||
[ForeignKey("UserId")]
|
||||
public virtual PerformerProfile User { get; set; }
|
||||
|
||||
[Required]
|
||||
public string DoesCode { get; set; }
|
||||
|
||||
[ForeignKey("DoesCode")]
|
||||
public virtual Activity Does { get; set; }
|
||||
|
||||
[Range(0,100)]
|
||||
public int Weight { get; set; }
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,9 @@
|
||||
using Yavsc.Models.Workflow;
|
||||
|
||||
namespace Yavsc.ViewModels.Manage
|
||||
{
|
||||
public class SetActivityViewModel : PerformerProfile
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,52 @@
|
||||
@model Yavsc.Models.Workflow.UserActivity
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Create";
|
||||
}
|
||||
|
||||
<h2>Create</h2>
|
||||
|
||||
<form asp-action="Create">
|
||||
<div class="form-horizontal">
|
||||
<h4>UserActivity</h4>
|
||||
<hr />
|
||||
<div asp-validation-summary="ValidationSummary.ModelOnly" class="text-danger"></div>
|
||||
|
||||
|
||||
<!-- <div class="form-group">
|
||||
<label asp-for="UserId" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<select asp-for="UserId" asp-items=@ViewBag.UserId class ="form-control"></select>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="form-group">
|
||||
<label asp-for="UserId" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<select asp-for="UserId" asp-items=@ViewBag.UserId class ="form-control"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="DoesCode" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<select asp-for="DoesCode" asp-items=@ViewBag.DoesCode class ="form-control"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Weight" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<input asp-for="Weight" class ="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-10">
|
||||
<input type="submit" value="Create" class="btn btn-default" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div>
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
|
||||
@ -0,0 +1,37 @@
|
||||
@model Yavsc.Models.Workflow.UserActivity
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Create";
|
||||
}
|
||||
|
||||
<h2>Create</h2>
|
||||
|
||||
<form asp-action="Create">
|
||||
<div class="form-horizontal">
|
||||
<h4>UserActivity</h4>
|
||||
<hr />
|
||||
<div asp-validation-summary="ValidationSummary.ModelOnly" class="text-danger"></div>
|
||||
<div class="form-group">
|
||||
<label asp-for="DoesCode" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<select asp-for="DoesCode" class ="form-control"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="UserId" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<select asp-for="UserId" class ="form-control"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-10">
|
||||
<input type="submit" value="Create" class="btn btn-default" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div>
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
|
||||
@ -0,0 +1,22 @@
|
||||
@model Yavsc.Models.Workflow.UserActivity
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Delete";
|
||||
}
|
||||
|
||||
<h2>Delete</h2>
|
||||
|
||||
<h3>Are you sure you want to delete this?</h3>
|
||||
<div>
|
||||
<h4>UserActivity</h4>
|
||||
<hr />
|
||||
<dl class="dl-horizontal">
|
||||
</dl>
|
||||
|
||||
<form asp-action="Delete">
|
||||
<div class="form-actions no-color">
|
||||
<input type="submit" value="Delete" class="btn btn-default" /> |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@ -0,0 +1,18 @@
|
||||
@model Yavsc.Models.Workflow.UserActivity
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Details";
|
||||
}
|
||||
|
||||
<h2>Details</h2>
|
||||
|
||||
<div>
|
||||
<h4>UserActivity</h4>
|
||||
<hr />
|
||||
<dl class="dl-horizontal">
|
||||
</dl>
|
||||
</div>
|
||||
<p>
|
||||
<a asp-action="Edit" asp-route-id="@Model.Id">Edit</a> |
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</p>
|
||||
@ -0,0 +1,39 @@
|
||||
@model Yavsc.Models.Workflow.UserActivity
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Edit";
|
||||
}
|
||||
|
||||
<h2>Edit</h2>
|
||||
|
||||
<form asp-action="Edit">
|
||||
<div class="form-horizontal">
|
||||
<h4>UserActivity</h4>
|
||||
<hr />
|
||||
<div asp-validation-summary="ValidationSummary.ModelOnly" class="text-danger"></div>
|
||||
<input type="hidden" asp-for="Id" />
|
||||
<div class="form-group">
|
||||
<label asp-for="DoesCode" class="control-label col-md-2">DoesCode</label>
|
||||
<div class="col-md-10">
|
||||
<select asp-for="DoesCode" class="form-control" />
|
||||
<span asp-validation-for="DoesCode" class="text-danger" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label asp-for="Weight" class="col-md-2 control-label"></label>
|
||||
<div class="col-md-10">
|
||||
<select asp-for="Weight" class ="form-control"></select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-10">
|
||||
<input type="submit" value="Save" class="btn btn-default" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div>
|
||||
<a asp-action="Index">Back to List</a>
|
||||
</div>
|
||||
|
||||
@ -0,0 +1,29 @@
|
||||
@model IEnumerable<Yavsc.Models.Workflow.UserActivity>
|
||||
|
||||
@{
|
||||
ViewData["Title"] = "Index";
|
||||
}
|
||||
|
||||
<h2>Index</h2>
|
||||
|
||||
<p>
|
||||
<a asp-action="Create">Create New</a>
|
||||
</p>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th>@SR["Activity"]</th>
|
||||
<th>@SR["Rate"]</th>
|
||||
</tr>
|
||||
|
||||
@foreach (var item in Model) {
|
||||
<tr>
|
||||
<td> @Html.Display("item.Name")
|
||||
</td>
|
||||
<td>
|
||||
<a asp-action="Edit" asp-route-id="@item.Id">Edit</a> |
|
||||
<a asp-action="Details" asp-route-id="@item.Id">Details</a> |
|
||||
<a asp-action="Delete" asp-route-id="@item.Id">Delete</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</table>
|
||||
Loading…
Reference in New Issue