mailling template key
This commit is contained in:
@ -23,17 +23,17 @@ namespace Yavsc.Server.Models.EMailing
|
|||||||
set;
|
set;
|
||||||
}
|
}
|
||||||
|
|
||||||
[Key,DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
[Key][MaxLength(256),MinLength(3)]
|
||||||
public long Id { get; set; }
|
public string Id { get; set; }
|
||||||
|
|
||||||
[MaxLengthAttribute(128),MinLength(3)]
|
[MaxLength(256),MinLength(3)]
|
||||||
public string Topic { get; set; }
|
public string Topic { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Markdown template to process
|
/// Markdown template to process
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[MaxLengthAttribute(64*1024)]
|
[MaxLength(64*1024)]
|
||||||
public string Body { get; set; }
|
public string Body { get; set; }
|
||||||
|
|
||||||
[EmailAddress()]
|
[EmailAddress()]
|
||||||
|
@ -1,8 +1,20 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using Yavsc.Abstract.Templates;
|
using Yavsc.Abstract.Templates;
|
||||||
using Yavsc.Models;
|
using Yavsc.Models;
|
||||||
|
|
||||||
namespace Yavsc.Templates
|
namespace Yavsc.Templates
|
||||||
{
|
{
|
||||||
|
public static class TemplateConstants
|
||||||
|
{
|
||||||
|
public static readonly Dictionary<string, Func<ApplicationUser, bool>> Criterias =
|
||||||
|
new Dictionary<string, Func<ApplicationUser, bool>>
|
||||||
|
{
|
||||||
|
{ "allow-monthly", u => u.AllowMonthlyEmail },
|
||||||
|
{ "email-not-confirmed", u => !u.EmailConfirmed && u.DateCreated < DateTime.Now.AddDays(-7) }
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
public abstract class UserOrientedTemplate: Template
|
public abstract class UserOrientedTemplate: Template
|
||||||
{
|
{
|
||||||
public ApplicationUser User { get; set; }
|
public ApplicationUser User { get; set; }
|
||||||
|
@ -32,7 +32,7 @@ namespace Yavsc.Controllers
|
|||||||
|
|
||||||
// GET: api/MailingTemplateApi/5
|
// GET: api/MailingTemplateApi/5
|
||||||
[HttpGet("{id}", Name = "GetMailingTemplate")]
|
[HttpGet("{id}", Name = "GetMailingTemplate")]
|
||||||
public async Task<IActionResult> GetMailingTemplate([FromRoute] long id)
|
public async Task<IActionResult> GetMailingTemplate([FromRoute] string id)
|
||||||
{
|
{
|
||||||
if (!ModelState.IsValid)
|
if (!ModelState.IsValid)
|
||||||
{
|
{
|
||||||
@ -51,7 +51,7 @@ namespace Yavsc.Controllers
|
|||||||
|
|
||||||
// PUT: api/MailingTemplateApi/5
|
// PUT: api/MailingTemplateApi/5
|
||||||
[HttpPut("{id}")]
|
[HttpPut("{id}")]
|
||||||
public async Task<IActionResult> PutMailingTemplate([FromRoute] long id, [FromBody] MailingTemplate mailingTemplate)
|
public async Task<IActionResult> PutMailingTemplate([FromRoute] string id, [FromBody] MailingTemplate mailingTemplate)
|
||||||
{
|
{
|
||||||
if (!ModelState.IsValid)
|
if (!ModelState.IsValid)
|
||||||
{
|
{
|
||||||
@ -117,7 +117,7 @@ namespace Yavsc.Controllers
|
|||||||
|
|
||||||
// DELETE: api/MailingTemplateApi/5
|
// DELETE: api/MailingTemplateApi/5
|
||||||
[HttpDelete("{id}")]
|
[HttpDelete("{id}")]
|
||||||
public async Task<IActionResult> DeleteMailingTemplate([FromRoute] long id)
|
public async Task<IActionResult> DeleteMailingTemplate([FromRoute] string id)
|
||||||
{
|
{
|
||||||
if (!ModelState.IsValid)
|
if (!ModelState.IsValid)
|
||||||
{
|
{
|
||||||
@ -145,7 +145,7 @@ namespace Yavsc.Controllers
|
|||||||
base.Dispose(disposing);
|
base.Dispose(disposing);
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool MailingTemplateExists(long id)
|
private bool MailingTemplateExists(string id)
|
||||||
{
|
{
|
||||||
return _context.MailingTemplate.Count(e => e.Id == id) > 0;
|
return _context.MailingTemplate.Count(e => e.Id == id) > 0;
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,8 @@ using Yavsc.Models;
|
|||||||
using Yavsc.Models.Calendar;
|
using Yavsc.Models.Calendar;
|
||||||
using Yavsc.Server.Models.EMailing;
|
using Yavsc.Server.Models.EMailing;
|
||||||
using Microsoft.AspNet.Authorization;
|
using Microsoft.AspNet.Authorization;
|
||||||
|
using Yavsc.Templates;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace Yavsc.Controllers
|
namespace Yavsc.Controllers
|
||||||
{
|
{
|
||||||
@ -31,7 +32,7 @@ namespace Yavsc.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
// GET: MailingTemplate/Details/5
|
// GET: MailingTemplate/Details/5
|
||||||
public async Task<IActionResult> Details(long? id)
|
public async Task<IActionResult> Details(string id)
|
||||||
{
|
{
|
||||||
if (id == null)
|
if (id == null)
|
||||||
{
|
{
|
||||||
@ -47,8 +48,7 @@ namespace Yavsc.Controllers
|
|||||||
return View(mailingTemplate);
|
return View(mailingTemplate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
List<SelectListItem> GetSelectFromEnum(Type enumType)
|
||||||
List<SelectListItem> GetSelectFromEnum(Type enumType )
|
|
||||||
{
|
{
|
||||||
|
|
||||||
var list = new List<SelectListItem>();
|
var list = new List<SelectListItem>();
|
||||||
@ -60,12 +60,15 @@ namespace Yavsc.Controllers
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// GET: MailingTemplate/Create
|
// GET: MailingTemplate/Create
|
||||||
public IActionResult Create()
|
public IActionResult Create()
|
||||||
{
|
{
|
||||||
ViewBag.ManagerId = new SelectList(_context.ApplicationUser, "Id", "UserName");
|
ViewBag.ManagerId = new SelectList(_context.ApplicationUser, "Id", "UserName");
|
||||||
ViewBag.ToSend = GetSelectFromEnum(typeof(Periodicity));
|
ViewBag.ToSend = GetSelectFromEnum(typeof(Periodicity));
|
||||||
|
ViewBag.Id = new SelectList(
|
||||||
|
TemplateConstants.Criterias.Select(
|
||||||
|
c => new SelectListItem{ Text = c.Key, Value = c.Key })
|
||||||
|
);
|
||||||
return View();
|
return View();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -82,11 +85,15 @@ namespace Yavsc.Controllers
|
|||||||
}
|
}
|
||||||
ViewBag.ManagerId = new SelectList(_context.ApplicationUser, "Id", "UserName");
|
ViewBag.ManagerId = new SelectList(_context.ApplicationUser, "Id", "UserName");
|
||||||
ViewBag.ToSend = GetSelectFromEnum(typeof(Periodicity));
|
ViewBag.ToSend = GetSelectFromEnum(typeof(Periodicity));
|
||||||
|
ViewBag.Id = new SelectList(
|
||||||
|
TemplateConstants.Criterias.Select(
|
||||||
|
c => new SelectListItem{ Text = c.Key, Value = c.Key })
|
||||||
|
);
|
||||||
return View(mailingTemplate);
|
return View(mailingTemplate);
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET: MailingTemplate/Edit/5
|
// GET: MailingTemplate/Edit/5
|
||||||
public async Task<IActionResult> Edit(long? id)
|
public async Task<IActionResult> Edit(string id)
|
||||||
{
|
{
|
||||||
if (id == null)
|
if (id == null)
|
||||||
{
|
{
|
||||||
@ -100,6 +107,10 @@ namespace Yavsc.Controllers
|
|||||||
}
|
}
|
||||||
ViewBag.ManagerId = new SelectList(_context.ApplicationUser, "Id", "UserName");
|
ViewBag.ManagerId = new SelectList(_context.ApplicationUser, "Id", "UserName");
|
||||||
ViewBag.ToSend = GetSelectFromEnum(typeof(Periodicity));
|
ViewBag.ToSend = GetSelectFromEnum(typeof(Periodicity));
|
||||||
|
ViewBag.Id = new SelectList(
|
||||||
|
TemplateConstants.Criterias.Select(
|
||||||
|
c => new SelectListItem{ Text = c.Key, Value = c.Key })
|
||||||
|
);
|
||||||
return View(mailingTemplate);
|
return View(mailingTemplate);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,12 +127,16 @@ namespace Yavsc.Controllers
|
|||||||
}
|
}
|
||||||
ViewBag.ManagerId = new SelectList(_context.ApplicationUser, "Id", "UserName");
|
ViewBag.ManagerId = new SelectList(_context.ApplicationUser, "Id", "UserName");
|
||||||
ViewBag.ToSend = GetSelectFromEnum(typeof(Periodicity));
|
ViewBag.ToSend = GetSelectFromEnum(typeof(Periodicity));
|
||||||
|
ViewBag.Id = new SelectList(
|
||||||
|
TemplateConstants.Criterias.Select(
|
||||||
|
c => new SelectListItem{ Text = c.Key, Value = c.Key })
|
||||||
|
);
|
||||||
return View(mailingTemplate);
|
return View(mailingTemplate);
|
||||||
}
|
}
|
||||||
|
|
||||||
// GET: MailingTemplate/Delete/5
|
// GET: MailingTemplate/Delete/5
|
||||||
[ActionName("Delete")]
|
[ActionName("Delete")]
|
||||||
public async Task<IActionResult> Delete(long? id)
|
public async Task<IActionResult> Delete(string id)
|
||||||
{
|
{
|
||||||
if (id == null)
|
if (id == null)
|
||||||
{
|
{
|
||||||
@ -140,7 +155,7 @@ namespace Yavsc.Controllers
|
|||||||
// POST: MailingTemplate/Delete/5
|
// POST: MailingTemplate/Delete/5
|
||||||
[HttpPost, ActionName("Delete")]
|
[HttpPost, ActionName("Delete")]
|
||||||
[ValidateAntiForgeryToken]
|
[ValidateAntiForgeryToken]
|
||||||
public async Task<IActionResult> DeleteConfirmed(long id)
|
public async Task<IActionResult> DeleteConfirmed(string id)
|
||||||
{
|
{
|
||||||
MailingTemplate mailingTemplate = await _context.MailingTemplate.SingleAsync(m => m.Id == id);
|
MailingTemplate mailingTemplate = await _context.MailingTemplate.SingleAsync(m => m.Id == id);
|
||||||
_context.MailingTemplate.Remove(mailingTemplate);
|
_context.MailingTemplate.Remove(mailingTemplate);
|
||||||
|
2070
src/Yavsc/Migrations/20210530122042_template-key.Designer.cs
generated
Normal file
2070
src/Yavsc/Migrations/20210530122042_template-key.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
970
src/Yavsc/Migrations/20210530122042_template-key.cs
Normal file
970
src/Yavsc/Migrations/20210530122042_template-key.cs
Normal file
@ -0,0 +1,970 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using Microsoft.Data.Entity.Migrations;
|
||||||
|
|
||||||
|
namespace Yavsc.Migrations
|
||||||
|
{
|
||||||
|
public partial class templatekey : 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_Ban_ApplicationUser_TargetId", table: "Ban");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_BlackListed_ApplicationUser_OwnerId", table: "BlackListed");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_BlackListed_ApplicationUser_UserId", table: "BlackListed");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_CircleAuthorizationToBlogPost_BlogPost_BlogPostId", table: "CircleAuthorizationToBlogPost");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_CircleAuthorizationToBlogPost_Circle_CircleId", table: "CircleAuthorizationToBlogPost");
|
||||||
|
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_Estimate_ApplicationUser_ClientId", table: "Estimate");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_BlogTag_BlogPost_PostId", table: "BlogTag");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_BlogTag_Tag_TagId", table: "BlogTag");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_Comment_ApplicationUser_AuthorId", table: "Comment");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_Comment_BlogPost_PostId", table: "Comment");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_Schedule_ApplicationUser_OwnerId", table: "Schedule");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_ChatConnection_ApplicationUser_ApplicationUserId", table: "ChatConnection");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_ChatRoomAccess_ApplicationUser_UserId", table: "ChatRoomAccess");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_BrusherProfile_PerformerProfile_UserId", table: "BrusherProfile");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_Activity_ActivityCode", table: "HairCutQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_ApplicationUser_ClientId", table: "HairCutQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_PerformerProfile_PerformerId", table: "HairCutQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_HairPrestation_PrestationId", table: "HairCutQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_Activity_ActivityCode", table: "HairMultiCutQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_ApplicationUser_ClientId", table: "HairMultiCutQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_PerformerProfile_PerformerId", table: "HairMultiCutQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairPrestationCollectionItem_HairPrestation_PrestationId", table: "HairPrestationCollectionItem");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairPrestationCollectionItem_HairMultiCutQuery_QueryId", table: "HairPrestationCollectionItem");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairTaint_Color_ColorId", table: "HairTaint");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairTaintInstance_HairPrestation_PrestationId", table: "HairTaintInstance");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairTaintInstance_HairTaint_TaintId", table: "HairTaintInstance");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_DimissClicked_Notification_NotificationId", table: "DimissClicked");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_InstrumentRating_Instrument_InstrumentId", table: "InstrumentRating");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_Instrumentation_Instrument_InstrumentId", table: "Instrumentation");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_CircleMember_Circle_CircleId", table: "CircleMember");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_Contact_PostalAddress_AddressId", table: "Contact");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_Location_OrganizationAddressId", table: "PerformerProfile");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_ApplicationUser_PerformerId", table: "PerformerProfile");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_RdvQuery_Activity_ActivityCode", table: "RdvQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_RdvQuery_ApplicationUser_ClientId", table: "RdvQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_RdvQuery_PerformerProfile_PerformerId", table: "RdvQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_CircleAuthorizationToFile_Circle_CircleId", table: "CircleAuthorizationToFile");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_MailingTemplate_ApplicationUser_ManagerId", table: "MailingTemplate");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_MailingTemplate_ApplicationUser_SuccessorId", table: "MailingTemplate");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_Project_Activity_ActivityCode", table: "Project");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_Project_ApplicationUser_ClientId", table: "Project");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_Project_GitRepositoryReference_GitId", table: "Project");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_Project_PerformerProfile_PerformerId", table: "Project");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_ProjectBuildConfiguration_Project_ProjectId", table: "ProjectBuildConfiguration");
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "Path",
|
||||||
|
table: "GitRepositoryReference",
|
||||||
|
nullable: true);
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "Name",
|
||||||
|
table: "ProjectBuildConfiguration",
|
||||||
|
nullable: true);
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "Name",
|
||||||
|
table: "Project",
|
||||||
|
nullable: true);
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "Id",
|
||||||
|
table: "MailingTemplate",
|
||||||
|
nullable: false);
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "SIREN",
|
||||||
|
table: "PerformerProfile",
|
||||||
|
nullable: true);
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "ActivityCode",
|
||||||
|
table: "CommandForm",
|
||||||
|
nullable: true);
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "Name",
|
||||||
|
table: "Activity",
|
||||||
|
nullable: true);
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "OwnerId",
|
||||||
|
table: "LiveFlow",
|
||||||
|
nullable: true);
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "Name",
|
||||||
|
table: "Tag",
|
||||||
|
nullable: true);
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "Address",
|
||||||
|
table: "Location",
|
||||||
|
nullable: true);
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "OwnerId",
|
||||||
|
table: "Circle",
|
||||||
|
nullable: true);
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "Name",
|
||||||
|
table: "Circle",
|
||||||
|
nullable: true);
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "ExecutorId",
|
||||||
|
table: "PayPalPayment",
|
||||||
|
nullable: true);
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "Name",
|
||||||
|
table: "MusicalTendency",
|
||||||
|
nullable: true);
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "Name",
|
||||||
|
table: "Instrument",
|
||||||
|
nullable: true);
|
||||||
|
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_Ban_ApplicationUser_TargetId",
|
||||||
|
table: "Ban",
|
||||||
|
column: "TargetId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_BlackListed_ApplicationUser_OwnerId",
|
||||||
|
table: "BlackListed",
|
||||||
|
column: "OwnerId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_BlackListed_ApplicationUser_UserId",
|
||||||
|
table: "BlackListed",
|
||||||
|
column: "UserId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_CircleAuthorizationToBlogPost_BlogPost_BlogPostId",
|
||||||
|
table: "CircleAuthorizationToBlogPost",
|
||||||
|
column: "BlogPostId",
|
||||||
|
principalTable: "BlogPost",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_CircleAuthorizationToBlogPost_Circle_CircleId",
|
||||||
|
table: "CircleAuthorizationToBlogPost",
|
||||||
|
column: "CircleId",
|
||||||
|
principalTable: "Circle",
|
||||||
|
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_Estimate_ApplicationUser_ClientId",
|
||||||
|
table: "Estimate",
|
||||||
|
column: "ClientId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_BlogTag_BlogPost_PostId",
|
||||||
|
table: "BlogTag",
|
||||||
|
column: "PostId",
|
||||||
|
principalTable: "BlogPost",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_BlogTag_Tag_TagId",
|
||||||
|
table: "BlogTag",
|
||||||
|
column: "TagId",
|
||||||
|
principalTable: "Tag",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Comment_ApplicationUser_AuthorId",
|
||||||
|
table: "Comment",
|
||||||
|
column: "AuthorId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Comment_BlogPost_PostId",
|
||||||
|
table: "Comment",
|
||||||
|
column: "PostId",
|
||||||
|
principalTable: "BlogPost",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Schedule_ApplicationUser_OwnerId",
|
||||||
|
table: "Schedule",
|
||||||
|
column: "OwnerId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_ChatConnection_ApplicationUser_ApplicationUserId",
|
||||||
|
table: "ChatConnection",
|
||||||
|
column: "ApplicationUserId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_ChatRoomAccess_ApplicationUser_UserId",
|
||||||
|
table: "ChatRoomAccess",
|
||||||
|
column: "UserId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_BrusherProfile_PerformerProfile_UserId",
|
||||||
|
table: "BrusherProfile",
|
||||||
|
column: "UserId",
|
||||||
|
principalTable: "PerformerProfile",
|
||||||
|
principalColumn: "PerformerId",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairCutQuery_Activity_ActivityCode",
|
||||||
|
table: "HairCutQuery",
|
||||||
|
column: "ActivityCode",
|
||||||
|
principalTable: "Activity",
|
||||||
|
principalColumn: "Code",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairCutQuery_ApplicationUser_ClientId",
|
||||||
|
table: "HairCutQuery",
|
||||||
|
column: "ClientId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairCutQuery_PerformerProfile_PerformerId",
|
||||||
|
table: "HairCutQuery",
|
||||||
|
column: "PerformerId",
|
||||||
|
principalTable: "PerformerProfile",
|
||||||
|
principalColumn: "PerformerId",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairCutQuery_HairPrestation_PrestationId",
|
||||||
|
table: "HairCutQuery",
|
||||||
|
column: "PrestationId",
|
||||||
|
principalTable: "HairPrestation",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairMultiCutQuery_Activity_ActivityCode",
|
||||||
|
table: "HairMultiCutQuery",
|
||||||
|
column: "ActivityCode",
|
||||||
|
principalTable: "Activity",
|
||||||
|
principalColumn: "Code",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairMultiCutQuery_ApplicationUser_ClientId",
|
||||||
|
table: "HairMultiCutQuery",
|
||||||
|
column: "ClientId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairMultiCutQuery_PerformerProfile_PerformerId",
|
||||||
|
table: "HairMultiCutQuery",
|
||||||
|
column: "PerformerId",
|
||||||
|
principalTable: "PerformerProfile",
|
||||||
|
principalColumn: "PerformerId",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairPrestationCollectionItem_HairPrestation_PrestationId",
|
||||||
|
table: "HairPrestationCollectionItem",
|
||||||
|
column: "PrestationId",
|
||||||
|
principalTable: "HairPrestation",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairPrestationCollectionItem_HairMultiCutQuery_QueryId",
|
||||||
|
table: "HairPrestationCollectionItem",
|
||||||
|
column: "QueryId",
|
||||||
|
principalTable: "HairMultiCutQuery",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairTaint_Color_ColorId",
|
||||||
|
table: "HairTaint",
|
||||||
|
column: "ColorId",
|
||||||
|
principalTable: "Color",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairTaintInstance_HairPrestation_PrestationId",
|
||||||
|
table: "HairTaintInstance",
|
||||||
|
column: "PrestationId",
|
||||||
|
principalTable: "HairPrestation",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairTaintInstance_HairTaint_TaintId",
|
||||||
|
table: "HairTaintInstance",
|
||||||
|
column: "TaintId",
|
||||||
|
principalTable: "HairTaint",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_DimissClicked_Notification_NotificationId",
|
||||||
|
table: "DimissClicked",
|
||||||
|
column: "NotificationId",
|
||||||
|
principalTable: "Notification",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_InstrumentRating_Instrument_InstrumentId",
|
||||||
|
table: "InstrumentRating",
|
||||||
|
column: "InstrumentId",
|
||||||
|
principalTable: "Instrument",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Instrumentation_Instrument_InstrumentId",
|
||||||
|
table: "Instrumentation",
|
||||||
|
column: "InstrumentId",
|
||||||
|
principalTable: "Instrument",
|
||||||
|
principalColumn: "Id",
|
||||||
|
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_Contact_PostalAddress_AddressId",
|
||||||
|
table: "Contact",
|
||||||
|
column: "AddressId",
|
||||||
|
principalTable: "PostalAddress",
|
||||||
|
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_RdvQuery_Activity_ActivityCode",
|
||||||
|
table: "RdvQuery",
|
||||||
|
column: "ActivityCode",
|
||||||
|
principalTable: "Activity",
|
||||||
|
principalColumn: "Code",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_RdvQuery_ApplicationUser_ClientId",
|
||||||
|
table: "RdvQuery",
|
||||||
|
column: "ClientId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_RdvQuery_PerformerProfile_PerformerId",
|
||||||
|
table: "RdvQuery",
|
||||||
|
column: "PerformerId",
|
||||||
|
principalTable: "PerformerProfile",
|
||||||
|
principalColumn: "PerformerId",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_CircleAuthorizationToFile_Circle_CircleId",
|
||||||
|
table: "CircleAuthorizationToFile",
|
||||||
|
column: "CircleId",
|
||||||
|
principalTable: "Circle",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_MailingTemplate_ApplicationUser_ManagerId",
|
||||||
|
table: "MailingTemplate",
|
||||||
|
column: "ManagerId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_MailingTemplate_ApplicationUser_SuccessorId",
|
||||||
|
table: "MailingTemplate",
|
||||||
|
column: "SuccessorId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Project_Activity_ActivityCode",
|
||||||
|
table: "Project",
|
||||||
|
column: "ActivityCode",
|
||||||
|
principalTable: "Activity",
|
||||||
|
principalColumn: "Code",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Project_ApplicationUser_ClientId",
|
||||||
|
table: "Project",
|
||||||
|
column: "ClientId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Project_GitRepositoryReference_GitId",
|
||||||
|
table: "Project",
|
||||||
|
column: "GitId",
|
||||||
|
principalTable: "GitRepositoryReference",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Project_PerformerProfile_PerformerId",
|
||||||
|
table: "Project",
|
||||||
|
column: "PerformerId",
|
||||||
|
principalTable: "PerformerProfile",
|
||||||
|
principalColumn: "PerformerId",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_ProjectBuildConfiguration_Project_ProjectId",
|
||||||
|
table: "ProjectBuildConfiguration",
|
||||||
|
column: "ProjectId",
|
||||||
|
principalTable: "Project",
|
||||||
|
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_Ban_ApplicationUser_TargetId", table: "Ban");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_BlackListed_ApplicationUser_OwnerId", table: "BlackListed");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_BlackListed_ApplicationUser_UserId", table: "BlackListed");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_CircleAuthorizationToBlogPost_BlogPost_BlogPostId", table: "CircleAuthorizationToBlogPost");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_CircleAuthorizationToBlogPost_Circle_CircleId", table: "CircleAuthorizationToBlogPost");
|
||||||
|
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_Estimate_ApplicationUser_ClientId", table: "Estimate");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_BlogTag_BlogPost_PostId", table: "BlogTag");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_BlogTag_Tag_TagId", table: "BlogTag");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_Comment_ApplicationUser_AuthorId", table: "Comment");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_Comment_BlogPost_PostId", table: "Comment");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_Schedule_ApplicationUser_OwnerId", table: "Schedule");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_ChatConnection_ApplicationUser_ApplicationUserId", table: "ChatConnection");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_ChatRoomAccess_ApplicationUser_UserId", table: "ChatRoomAccess");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_BrusherProfile_PerformerProfile_UserId", table: "BrusherProfile");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_Activity_ActivityCode", table: "HairCutQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_ApplicationUser_ClientId", table: "HairCutQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_PerformerProfile_PerformerId", table: "HairCutQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairCutQuery_HairPrestation_PrestationId", table: "HairCutQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_Activity_ActivityCode", table: "HairMultiCutQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_ApplicationUser_ClientId", table: "HairMultiCutQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairMultiCutQuery_PerformerProfile_PerformerId", table: "HairMultiCutQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairPrestationCollectionItem_HairPrestation_PrestationId", table: "HairPrestationCollectionItem");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairPrestationCollectionItem_HairMultiCutQuery_QueryId", table: "HairPrestationCollectionItem");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairTaint_Color_ColorId", table: "HairTaint");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairTaintInstance_HairPrestation_PrestationId", table: "HairTaintInstance");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_HairTaintInstance_HairTaint_TaintId", table: "HairTaintInstance");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_DimissClicked_Notification_NotificationId", table: "DimissClicked");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_InstrumentRating_Instrument_InstrumentId", table: "InstrumentRating");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_Instrumentation_Instrument_InstrumentId", table: "Instrumentation");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_CircleMember_Circle_CircleId", table: "CircleMember");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_Contact_PostalAddress_AddressId", table: "Contact");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_Location_OrganizationAddressId", table: "PerformerProfile");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_PerformerProfile_ApplicationUser_PerformerId", table: "PerformerProfile");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_RdvQuery_Activity_ActivityCode", table: "RdvQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_RdvQuery_ApplicationUser_ClientId", table: "RdvQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_RdvQuery_PerformerProfile_PerformerId", table: "RdvQuery");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_CircleAuthorizationToFile_Circle_CircleId", table: "CircleAuthorizationToFile");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_MailingTemplate_ApplicationUser_ManagerId", table: "MailingTemplate");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_MailingTemplate_ApplicationUser_SuccessorId", table: "MailingTemplate");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_Project_Activity_ActivityCode", table: "Project");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_Project_ApplicationUser_ClientId", table: "Project");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_Project_GitRepositoryReference_GitId", table: "Project");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_Project_PerformerProfile_PerformerId", table: "Project");
|
||||||
|
migrationBuilder.DropForeignKey(name: "FK_ProjectBuildConfiguration_Project_ProjectId", table: "ProjectBuildConfiguration");
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "Path",
|
||||||
|
table: "GitRepositoryReference",
|
||||||
|
nullable: false);
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "Name",
|
||||||
|
table: "ProjectBuildConfiguration",
|
||||||
|
nullable: false);
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "Name",
|
||||||
|
table: "Project",
|
||||||
|
nullable: false);
|
||||||
|
migrationBuilder.AlterColumn<long>(
|
||||||
|
name: "Id",
|
||||||
|
table: "MailingTemplate",
|
||||||
|
nullable: false)
|
||||||
|
.Annotation("Npgsql:Serial", true);
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "SIREN",
|
||||||
|
table: "PerformerProfile",
|
||||||
|
nullable: false);
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "ActivityCode",
|
||||||
|
table: "CommandForm",
|
||||||
|
nullable: false);
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "Name",
|
||||||
|
table: "Activity",
|
||||||
|
nullable: false);
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "OwnerId",
|
||||||
|
table: "LiveFlow",
|
||||||
|
nullable: false);
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "Name",
|
||||||
|
table: "Tag",
|
||||||
|
nullable: false);
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "Address",
|
||||||
|
table: "Location",
|
||||||
|
nullable: false);
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "OwnerId",
|
||||||
|
table: "Circle",
|
||||||
|
nullable: false);
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "Name",
|
||||||
|
table: "Circle",
|
||||||
|
nullable: false);
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "ExecutorId",
|
||||||
|
table: "PayPalPayment",
|
||||||
|
nullable: false);
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "Name",
|
||||||
|
table: "MusicalTendency",
|
||||||
|
nullable: false);
|
||||||
|
migrationBuilder.AlterColumn<string>(
|
||||||
|
name: "Name",
|
||||||
|
table: "Instrument",
|
||||||
|
nullable: false);
|
||||||
|
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_Ban_ApplicationUser_TargetId",
|
||||||
|
table: "Ban",
|
||||||
|
column: "TargetId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_BlackListed_ApplicationUser_OwnerId",
|
||||||
|
table: "BlackListed",
|
||||||
|
column: "OwnerId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_BlackListed_ApplicationUser_UserId",
|
||||||
|
table: "BlackListed",
|
||||||
|
column: "UserId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_CircleAuthorizationToBlogPost_BlogPost_BlogPostId",
|
||||||
|
table: "CircleAuthorizationToBlogPost",
|
||||||
|
column: "BlogPostId",
|
||||||
|
principalTable: "BlogPost",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_CircleAuthorizationToBlogPost_Circle_CircleId",
|
||||||
|
table: "CircleAuthorizationToBlogPost",
|
||||||
|
column: "CircleId",
|
||||||
|
principalTable: "Circle",
|
||||||
|
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_Estimate_ApplicationUser_ClientId",
|
||||||
|
table: "Estimate",
|
||||||
|
column: "ClientId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_BlogTag_BlogPost_PostId",
|
||||||
|
table: "BlogTag",
|
||||||
|
column: "PostId",
|
||||||
|
principalTable: "BlogPost",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_BlogTag_Tag_TagId",
|
||||||
|
table: "BlogTag",
|
||||||
|
column: "TagId",
|
||||||
|
principalTable: "Tag",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Comment_ApplicationUser_AuthorId",
|
||||||
|
table: "Comment",
|
||||||
|
column: "AuthorId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Comment_BlogPost_PostId",
|
||||||
|
table: "Comment",
|
||||||
|
column: "PostId",
|
||||||
|
principalTable: "BlogPost",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Schedule_ApplicationUser_OwnerId",
|
||||||
|
table: "Schedule",
|
||||||
|
column: "OwnerId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_ChatConnection_ApplicationUser_ApplicationUserId",
|
||||||
|
table: "ChatConnection",
|
||||||
|
column: "ApplicationUserId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_ChatRoomAccess_ApplicationUser_UserId",
|
||||||
|
table: "ChatRoomAccess",
|
||||||
|
column: "UserId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_BrusherProfile_PerformerProfile_UserId",
|
||||||
|
table: "BrusherProfile",
|
||||||
|
column: "UserId",
|
||||||
|
principalTable: "PerformerProfile",
|
||||||
|
principalColumn: "PerformerId",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairCutQuery_Activity_ActivityCode",
|
||||||
|
table: "HairCutQuery",
|
||||||
|
column: "ActivityCode",
|
||||||
|
principalTable: "Activity",
|
||||||
|
principalColumn: "Code",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairCutQuery_ApplicationUser_ClientId",
|
||||||
|
table: "HairCutQuery",
|
||||||
|
column: "ClientId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairCutQuery_PerformerProfile_PerformerId",
|
||||||
|
table: "HairCutQuery",
|
||||||
|
column: "PerformerId",
|
||||||
|
principalTable: "PerformerProfile",
|
||||||
|
principalColumn: "PerformerId",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairCutQuery_HairPrestation_PrestationId",
|
||||||
|
table: "HairCutQuery",
|
||||||
|
column: "PrestationId",
|
||||||
|
principalTable: "HairPrestation",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairMultiCutQuery_Activity_ActivityCode",
|
||||||
|
table: "HairMultiCutQuery",
|
||||||
|
column: "ActivityCode",
|
||||||
|
principalTable: "Activity",
|
||||||
|
principalColumn: "Code",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairMultiCutQuery_ApplicationUser_ClientId",
|
||||||
|
table: "HairMultiCutQuery",
|
||||||
|
column: "ClientId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairMultiCutQuery_PerformerProfile_PerformerId",
|
||||||
|
table: "HairMultiCutQuery",
|
||||||
|
column: "PerformerId",
|
||||||
|
principalTable: "PerformerProfile",
|
||||||
|
principalColumn: "PerformerId",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairPrestationCollectionItem_HairPrestation_PrestationId",
|
||||||
|
table: "HairPrestationCollectionItem",
|
||||||
|
column: "PrestationId",
|
||||||
|
principalTable: "HairPrestation",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairPrestationCollectionItem_HairMultiCutQuery_QueryId",
|
||||||
|
table: "HairPrestationCollectionItem",
|
||||||
|
column: "QueryId",
|
||||||
|
principalTable: "HairMultiCutQuery",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairTaint_Color_ColorId",
|
||||||
|
table: "HairTaint",
|
||||||
|
column: "ColorId",
|
||||||
|
principalTable: "Color",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairTaintInstance_HairPrestation_PrestationId",
|
||||||
|
table: "HairTaintInstance",
|
||||||
|
column: "PrestationId",
|
||||||
|
principalTable: "HairPrestation",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_HairTaintInstance_HairTaint_TaintId",
|
||||||
|
table: "HairTaintInstance",
|
||||||
|
column: "TaintId",
|
||||||
|
principalTable: "HairTaint",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_DimissClicked_Notification_NotificationId",
|
||||||
|
table: "DimissClicked",
|
||||||
|
column: "NotificationId",
|
||||||
|
principalTable: "Notification",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_InstrumentRating_Instrument_InstrumentId",
|
||||||
|
table: "InstrumentRating",
|
||||||
|
column: "InstrumentId",
|
||||||
|
principalTable: "Instrument",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Instrumentation_Instrument_InstrumentId",
|
||||||
|
table: "Instrumentation",
|
||||||
|
column: "InstrumentId",
|
||||||
|
principalTable: "Instrument",
|
||||||
|
principalColumn: "Id",
|
||||||
|
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_Contact_PostalAddress_AddressId",
|
||||||
|
table: "Contact",
|
||||||
|
column: "AddressId",
|
||||||
|
principalTable: "PostalAddress",
|
||||||
|
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_RdvQuery_Activity_ActivityCode",
|
||||||
|
table: "RdvQuery",
|
||||||
|
column: "ActivityCode",
|
||||||
|
principalTable: "Activity",
|
||||||
|
principalColumn: "Code",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_RdvQuery_ApplicationUser_ClientId",
|
||||||
|
table: "RdvQuery",
|
||||||
|
column: "ClientId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_RdvQuery_PerformerProfile_PerformerId",
|
||||||
|
table: "RdvQuery",
|
||||||
|
column: "PerformerId",
|
||||||
|
principalTable: "PerformerProfile",
|
||||||
|
principalColumn: "PerformerId",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_CircleAuthorizationToFile_Circle_CircleId",
|
||||||
|
table: "CircleAuthorizationToFile",
|
||||||
|
column: "CircleId",
|
||||||
|
principalTable: "Circle",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_MailingTemplate_ApplicationUser_ManagerId",
|
||||||
|
table: "MailingTemplate",
|
||||||
|
column: "ManagerId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_MailingTemplate_ApplicationUser_SuccessorId",
|
||||||
|
table: "MailingTemplate",
|
||||||
|
column: "SuccessorId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Project_Activity_ActivityCode",
|
||||||
|
table: "Project",
|
||||||
|
column: "ActivityCode",
|
||||||
|
principalTable: "Activity",
|
||||||
|
principalColumn: "Code",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Project_ApplicationUser_ClientId",
|
||||||
|
table: "Project",
|
||||||
|
column: "ClientId",
|
||||||
|
principalTable: "AspNetUsers",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Project_GitRepositoryReference_GitId",
|
||||||
|
table: "Project",
|
||||||
|
column: "GitId",
|
||||||
|
principalTable: "GitRepositoryReference",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_Project_PerformerProfile_PerformerId",
|
||||||
|
table: "Project",
|
||||||
|
column: "PerformerId",
|
||||||
|
principalTable: "PerformerProfile",
|
||||||
|
principalColumn: "PerformerId",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
migrationBuilder.AddForeignKey(
|
||||||
|
name: "FK_ProjectBuildConfiguration_Project_ProjectId",
|
||||||
|
table: "ProjectBuildConfiguration",
|
||||||
|
column: "ProjectId",
|
||||||
|
principalTable: "Project",
|
||||||
|
principalColumn: "Id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -335,22 +335,17 @@ namespace Yavsc.Migrations
|
|||||||
b.Property<long>("Id")
|
b.Property<long>("Id")
|
||||||
.ValueGeneratedOnAdd();
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
b.Property<string>("AccountNumber")
|
b.Property<string>("AccountNumber");
|
||||||
.HasAnnotation("MaxLength", 15);
|
|
||||||
|
|
||||||
b.Property<string>("BIC")
|
b.Property<string>("BIC");
|
||||||
.HasAnnotation("MaxLength", 15);
|
|
||||||
|
|
||||||
b.Property<string>("BankCode")
|
b.Property<string>("BankCode");
|
||||||
.HasAnnotation("MaxLength", 5);
|
|
||||||
|
|
||||||
b.Property<int>("BankedKey");
|
b.Property<int>("BankedKey");
|
||||||
|
|
||||||
b.Property<string>("IBAN")
|
b.Property<string>("IBAN");
|
||||||
.HasAnnotation("MaxLength", 33);
|
|
||||||
|
|
||||||
b.Property<string>("WicketCode")
|
b.Property<string>("WicketCode");
|
||||||
.HasAnnotation("MaxLength", 5);
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
});
|
});
|
||||||
@ -440,23 +435,19 @@ namespace Yavsc.Migrations
|
|||||||
|
|
||||||
b.Property<string>("AuthorId");
|
b.Property<string>("AuthorId");
|
||||||
|
|
||||||
b.Property<string>("Content")
|
b.Property<string>("Content");
|
||||||
.HasAnnotation("MaxLength", 56224);
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateCreated");
|
b.Property<DateTime>("DateCreated");
|
||||||
|
|
||||||
b.Property<DateTime>("DateModified");
|
b.Property<DateTime>("DateModified");
|
||||||
|
|
||||||
b.Property<string>("Lang")
|
b.Property<string>("Lang");
|
||||||
.HasAnnotation("MaxLength", 8);
|
|
||||||
|
|
||||||
b.Property<string>("Photo")
|
b.Property<string>("Photo");
|
||||||
.HasAnnotation("MaxLength", 1024);
|
|
||||||
|
|
||||||
b.Property<int>("Rate");
|
b.Property<int>("Rate");
|
||||||
|
|
||||||
b.Property<string>("Title")
|
b.Property<string>("Title");
|
||||||
.HasAnnotation("MaxLength", 1024);
|
|
||||||
|
|
||||||
b.Property<string>("UserCreated");
|
b.Property<string>("UserCreated");
|
||||||
|
|
||||||
@ -484,8 +475,7 @@ namespace Yavsc.Migrations
|
|||||||
b.Property<string>("AuthorId")
|
b.Property<string>("AuthorId")
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.Property<string>("Content")
|
b.Property<string>("Content");
|
||||||
.HasAnnotation("MaxLength", 1024);
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateCreated");
|
b.Property<DateTime>("DateCreated");
|
||||||
|
|
||||||
@ -552,8 +542,7 @@ namespace Yavsc.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("Yavsc.Models.Chat.ChatRoom", b =>
|
modelBuilder.Entity("Yavsc.Models.Chat.ChatRoom", b =>
|
||||||
{
|
{
|
||||||
b.Property<string>("Name")
|
b.Property<string>("Name");
|
||||||
.HasAnnotation("MaxLength", 255);
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateCreated");
|
b.Property<DateTime>("DateCreated");
|
||||||
|
|
||||||
@ -715,8 +704,7 @@ namespace Yavsc.Migrations
|
|||||||
b.Property<string>("ActivityCode")
|
b.Property<string>("ActivityCode")
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.Property<string>("AdditionalInfo")
|
b.Property<string>("AdditionalInfo");
|
||||||
.HasAnnotation("MaxLength", 512);
|
|
||||||
|
|
||||||
b.Property<string>("ClientId")
|
b.Property<string>("ClientId")
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
@ -885,11 +873,9 @@ namespace Yavsc.Migrations
|
|||||||
b.Property<long>("Id")
|
b.Property<long>("Id")
|
||||||
.ValueGeneratedOnAdd();
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
b.Property<string>("Description")
|
b.Property<string>("Description");
|
||||||
.HasAnnotation("MaxLength", 10240);
|
|
||||||
|
|
||||||
b.Property<string>("ShortName")
|
b.Property<string>("ShortName");
|
||||||
.HasAnnotation("MaxLength", 256);
|
|
||||||
|
|
||||||
b.Property<int>("Status");
|
b.Property<int>("Status");
|
||||||
|
|
||||||
@ -1014,7 +1000,6 @@ namespace Yavsc.Migrations
|
|||||||
.ValueGeneratedOnAdd();
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
b.Property<string>("Name")
|
b.Property<string>("Name")
|
||||||
.IsRequired()
|
|
||||||
.HasAnnotation("MaxLength", 255);
|
.HasAnnotation("MaxLength", 255);
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
@ -1057,7 +1042,6 @@ namespace Yavsc.Migrations
|
|||||||
.ValueGeneratedOnAdd();
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
b.Property<string>("Name")
|
b.Property<string>("Name")
|
||||||
.IsRequired()
|
|
||||||
.HasAnnotation("MaxLength", 255);
|
.HasAnnotation("MaxLength", 255);
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
@ -1096,8 +1080,7 @@ namespace Yavsc.Migrations
|
|||||||
|
|
||||||
b.Property<DateTime>("DateModified");
|
b.Property<DateTime>("DateModified");
|
||||||
|
|
||||||
b.Property<string>("ExecutorId")
|
b.Property<string>("ExecutorId");
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Property<string>("OrderReference");
|
b.Property<string>("OrderReference");
|
||||||
|
|
||||||
@ -1119,11 +1102,9 @@ namespace Yavsc.Migrations
|
|||||||
|
|
||||||
b.Property<string>("ApplicationUserId");
|
b.Property<string>("ApplicationUserId");
|
||||||
|
|
||||||
b.Property<string>("Name")
|
b.Property<string>("Name");
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Property<string>("OwnerId")
|
b.Property<string>("OwnerId");
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Property<bool>("Public");
|
b.Property<bool>("Public");
|
||||||
|
|
||||||
@ -1179,7 +1160,6 @@ namespace Yavsc.Migrations
|
|||||||
.ValueGeneratedOnAdd();
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
b.Property<string>("Address")
|
b.Property<string>("Address")
|
||||||
.IsRequired()
|
|
||||||
.HasAnnotation("MaxLength", 512);
|
.HasAnnotation("MaxLength", 512);
|
||||||
|
|
||||||
b.Property<double>("Latitude");
|
b.Property<double>("Latitude");
|
||||||
@ -1216,8 +1196,7 @@ namespace Yavsc.Migrations
|
|||||||
b.Property<long>("Id")
|
b.Property<long>("Id")
|
||||||
.ValueGeneratedOnAdd();
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
b.Property<string>("Name")
|
b.Property<string>("Name");
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
});
|
});
|
||||||
@ -1239,30 +1218,24 @@ namespace Yavsc.Migrations
|
|||||||
b.Property<long>("Id")
|
b.Property<long>("Id")
|
||||||
.ValueGeneratedOnAdd();
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
b.Property<string>("DifferedFileName")
|
b.Property<string>("DifferedFileName");
|
||||||
.HasAnnotation("MaxLength", 255);
|
|
||||||
|
|
||||||
b.Property<string>("MediaType")
|
b.Property<string>("MediaType");
|
||||||
.HasAnnotation("MaxLength", 127);
|
|
||||||
|
|
||||||
b.Property<string>("OwnerId")
|
b.Property<string>("OwnerId");
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Property<string>("Pitch")
|
b.Property<string>("Pitch");
|
||||||
.HasAnnotation("MaxLength", 1023);
|
|
||||||
|
|
||||||
b.Property<int>("SequenceNumber");
|
b.Property<int>("SequenceNumber");
|
||||||
|
|
||||||
b.Property<string>("Title")
|
b.Property<string>("Title");
|
||||||
.HasAnnotation("MaxLength", 255);
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Yavsc.Models.Workflow.Activity", b =>
|
modelBuilder.Entity("Yavsc.Models.Workflow.Activity", b =>
|
||||||
{
|
{
|
||||||
b.Property<string>("Code")
|
b.Property<string>("Code");
|
||||||
.HasAnnotation("MaxLength", 512);
|
|
||||||
|
|
||||||
b.Property<DateTime>("DateCreated");
|
b.Property<DateTime>("DateCreated");
|
||||||
|
|
||||||
@ -1274,12 +1247,9 @@ namespace Yavsc.Migrations
|
|||||||
|
|
||||||
b.Property<string>("ModeratorGroupName");
|
b.Property<string>("ModeratorGroupName");
|
||||||
|
|
||||||
b.Property<string>("Name")
|
b.Property<string>("Name");
|
||||||
.IsRequired()
|
|
||||||
.HasAnnotation("MaxLength", 512);
|
|
||||||
|
|
||||||
b.Property<string>("ParentCode")
|
b.Property<string>("ParentCode");
|
||||||
.HasAnnotation("MaxLength", 512);
|
|
||||||
|
|
||||||
b.Property<string>("Photo");
|
b.Property<string>("Photo");
|
||||||
|
|
||||||
@ -1301,8 +1271,7 @@ namespace Yavsc.Migrations
|
|||||||
|
|
||||||
b.Property<string>("ActionName");
|
b.Property<string>("ActionName");
|
||||||
|
|
||||||
b.Property<string>("ActivityCode")
|
b.Property<string>("ActivityCode");
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Property<string>("Title");
|
b.Property<string>("Title");
|
||||||
|
|
||||||
@ -1341,9 +1310,7 @@ namespace Yavsc.Migrations
|
|||||||
|
|
||||||
b.Property<int>("Rate");
|
b.Property<int>("Rate");
|
||||||
|
|
||||||
b.Property<string>("SIREN")
|
b.Property<string>("SIREN");
|
||||||
.IsRequired()
|
|
||||||
.HasAnnotation("MaxLength", 14);
|
|
||||||
|
|
||||||
b.Property<bool>("UseGeoLocalizationToReduceDistanceWithClients");
|
b.Property<bool>("UseGeoLocalizationToReduceDistanceWithClients");
|
||||||
|
|
||||||
@ -1447,8 +1414,8 @@ namespace Yavsc.Migrations
|
|||||||
|
|
||||||
modelBuilder.Entity("Yavsc.Server.Models.EMailing.MailingTemplate", b =>
|
modelBuilder.Entity("Yavsc.Server.Models.EMailing.MailingTemplate", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("Id")
|
b.Property<string>("Id")
|
||||||
.ValueGeneratedOnAdd();
|
.HasAnnotation("MaxLength", 256);
|
||||||
|
|
||||||
b.Property<string>("Body")
|
b.Property<string>("Body")
|
||||||
.HasAnnotation("MaxLength", 65536);
|
.HasAnnotation("MaxLength", 65536);
|
||||||
@ -1468,7 +1435,7 @@ namespace Yavsc.Migrations
|
|||||||
b.Property<int>("ToSend");
|
b.Property<int>("ToSend");
|
||||||
|
|
||||||
b.Property<string>("Topic")
|
b.Property<string>("Topic")
|
||||||
.HasAnnotation("MaxLength", 128);
|
.HasAnnotation("MaxLength", 256);
|
||||||
|
|
||||||
b.Property<string>("UserCreated");
|
b.Property<string>("UserCreated");
|
||||||
|
|
||||||
@ -1498,8 +1465,7 @@ namespace Yavsc.Migrations
|
|||||||
|
|
||||||
b.Property<long>("GitId");
|
b.Property<long>("GitId");
|
||||||
|
|
||||||
b.Property<string>("Name")
|
b.Property<string>("Name");
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Property<string>("OwnerId");
|
b.Property<string>("OwnerId");
|
||||||
|
|
||||||
@ -1532,8 +1498,7 @@ namespace Yavsc.Migrations
|
|||||||
b.Property<long>("Id")
|
b.Property<long>("Id")
|
||||||
.ValueGeneratedOnAdd();
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
b.Property<string>("Name")
|
b.Property<string>("Name");
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Property<long>("ProjectId");
|
b.Property<long>("ProjectId");
|
||||||
|
|
||||||
@ -1545,17 +1510,13 @@ namespace Yavsc.Migrations
|
|||||||
b.Property<long>("Id")
|
b.Property<long>("Id")
|
||||||
.ValueGeneratedOnAdd();
|
.ValueGeneratedOnAdd();
|
||||||
|
|
||||||
b.Property<string>("Branch")
|
b.Property<string>("Branch");
|
||||||
.HasAnnotation("MaxLength", 512);
|
|
||||||
|
|
||||||
b.Property<string>("OwnerId")
|
b.Property<string>("OwnerId");
|
||||||
.HasAnnotation("MaxLength", 1024);
|
|
||||||
|
|
||||||
b.Property<string>("Path")
|
b.Property<string>("Path");
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.Property<string>("Url")
|
b.Property<string>("Url");
|
||||||
.HasAnnotation("MaxLength", 2048);
|
|
||||||
|
|
||||||
b.HasKey("Id");
|
b.HasKey("Id");
|
||||||
});
|
});
|
||||||
|
@ -63,12 +63,7 @@ namespace Yavsc.Lib
|
|||||||
razorEngine = new RazorTemplateEngine(host);
|
razorEngine = new RazorTemplateEngine(host);
|
||||||
}
|
}
|
||||||
|
|
||||||
public string GenerateTemplateObject(string baseclassName = DefaultBaseClassName)
|
public void SendMonthlyEmail(string templateCode, string baseclassName = DefaultBaseClassName)
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void SendMonthlyEmail(long templateCode, string baseclassName = DefaultBaseClassName)
|
|
||||||
{
|
{
|
||||||
string className = "Generated" + baseclassName;
|
string className = "Generated" + baseclassName;
|
||||||
|
|
||||||
|
@ -11,6 +11,14 @@
|
|||||||
<h4>MailingTemplate</h4>
|
<h4>MailingTemplate</h4>
|
||||||
<hr />
|
<hr />
|
||||||
<div asp-validation-summary="ValidationSummary.ModelOnly" class="text-danger"></div>
|
<div asp-validation-summary="ValidationSummary.ModelOnly" class="text-danger"></div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label asp-for="Id" class="control-label col-md-2">@SR["Id"]</label>
|
||||||
|
<div class="col-md-10">
|
||||||
|
<select asp-for="Id" asp-items="@ViewBag.Id" class="form-control" >
|
||||||
|
</select>
|
||||||
|
<span asp-validation-for="Id" class="text-danger" ></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label asp-for="Body" class="col-md-2 control-label"></label>
|
<label asp-for="Body" class="col-md-2 control-label"></label>
|
||||||
<div class="col-md-10">
|
<div class="col-md-10">
|
||||||
|
@ -13,7 +13,14 @@
|
|||||||
<h4>MailingTemplate</h4>
|
<h4>MailingTemplate</h4>
|
||||||
<hr />
|
<hr />
|
||||||
<div asp-validation-summary="ValidationSummary.ModelOnly" class="text-danger"></div>
|
<div asp-validation-summary="ValidationSummary.ModelOnly" class="text-danger"></div>
|
||||||
<input type="hidden" asp-for="Id" />
|
<div class="form-group">
|
||||||
|
<label asp-for="Id" class="control-label col-md-2">@SR["Id"]</label>
|
||||||
|
<div class="col-md-10">
|
||||||
|
<select asp-for="Id" asp-items="@ViewBag.Id" class="form-control" >
|
||||||
|
</select>
|
||||||
|
<span asp-validation-for="Id" class="text-danger" ></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label asp-for="Body" class="col-md-2 control-label"></label>
|
<label asp-for="Body" class="col-md-2 control-label"></label>
|
||||||
<div class="col-md-10">
|
<div class="col-md-10">
|
||||||
|
@ -9,17 +9,12 @@ using System.Linq;
|
|||||||
using Yavsc.Models;
|
using Yavsc.Models;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System;
|
using System;
|
||||||
|
using Yavsc.Templates;
|
||||||
|
|
||||||
namespace cli
|
namespace cli
|
||||||
{
|
{
|
||||||
public class SendMailCommandProvider : ICommander
|
public class SendMailCommandProvider : ICommander
|
||||||
{
|
{
|
||||||
readonly Dictionary<string, Func<ApplicationUser, bool>> Criterias =
|
|
||||||
new Dictionary<string, Func<ApplicationUser, bool>>
|
|
||||||
{
|
|
||||||
{"allow-monthly", u => u.AllowMonthlyEmail },
|
|
||||||
{ "email-not-confirmed", u => !u.EmailConfirmed }
|
|
||||||
};
|
|
||||||
public CommandLineApplication Integrate(CommandLineApplication rootApp)
|
public CommandLineApplication Integrate(CommandLineApplication rootApp)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -43,9 +38,7 @@ namespace cli
|
|||||||
|
|
||||||
sendMailCommandApp.OnExecute(() =>
|
sendMailCommandApp.OnExecute(() =>
|
||||||
{
|
{
|
||||||
int code;
|
bool showhelp = TemplateConstants.Criterias.ContainsKey(critCommandArg.Value);
|
||||||
bool showhelp = !int.TryParse(codeCommandArg.Value, out code)
|
|
||||||
|| Criterias.ContainsKey(critCommandArg.Value);
|
|
||||||
|
|
||||||
if (!showhelp)
|
if (!showhelp)
|
||||||
{
|
{
|
||||||
@ -60,7 +53,7 @@ namespace cli
|
|||||||
var loggerFactory = app.Services.GetService<ILoggerFactory>();
|
var loggerFactory = app.Services.GetService<ILoggerFactory>();
|
||||||
var logger = loggerFactory.CreateLogger<Program>();
|
var logger = loggerFactory.CreateLogger<Program>();
|
||||||
logger.LogInformation("Starting emailling");
|
logger.LogInformation("Starting emailling");
|
||||||
mailer.SendEmailFromCriteria(code, Criterias[critCommandArg.Value]);
|
mailer.SendEmailFromCriteria(critCommandArg.Value, TemplateConstants.Criterias[critCommandArg.Value]);
|
||||||
logger.LogInformation("Finished emailling");
|
logger.LogInformation("Finished emailling");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -61,7 +61,7 @@ namespace cli.Services
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void SendEmailFromCriteria(long templateCode, Func<ApplicationUser,bool> criteria)
|
public void SendEmailFromCriteria(string templateCode, Func<ApplicationUser,bool> criteria)
|
||||||
{
|
{
|
||||||
string className = "GeneratedTemplate";
|
string className = "GeneratedTemplate";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user