vnext
Paul Schneider 6 years ago
parent 06fdc78de7
commit bf8ea11410
10 changed files with 2781 additions and 27 deletions

@ -0,0 +1,9 @@
namespace Yavsc.Server.Models.IT.SourceCode
{
public class GitRepositoryReference
{
public string Url { get; set; }
public string Path { get; set; }
public string Branch { get; set; }
}
}

@ -0,0 +1,148 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNet.Http;
using Microsoft.AspNet.Mvc;
using Microsoft.Data.Entity;
using Yavsc.Models;
using Yavsc.Server.Models.IT.SourceCode;
namespace Yavsc.Controllers
{
[Produces("application/json")]
[Route("api/GitRefsApi")]
public class GitRefsApiController : Controller
{
private ApplicationDbContext _context;
public GitRefsApiController(ApplicationDbContext context)
{
_context = context;
}
// GET: api/GitRefsApi
[HttpGet]
public IEnumerable<GitRepositoryReference> GetGitRepositoryReference()
{
return _context.GitRepositoryReference;
}
// GET: api/GitRefsApi/5
[HttpGet("{id}", Name = "GetGitRepositoryReference")]
public async Task<IActionResult> GetGitRepositoryReference([FromRoute] string id)
{
if (!ModelState.IsValid)
{
return HttpBadRequest(ModelState);
}
GitRepositoryReference gitRepositoryReference = await _context.GitRepositoryReference.SingleAsync(m => m.Path == id);
if (gitRepositoryReference == null)
{
return HttpNotFound();
}
return Ok(gitRepositoryReference);
}
// PUT: api/GitRefsApi/5
[HttpPut("{id}")]
public async Task<IActionResult> PutGitRepositoryReference([FromRoute] string id, [FromBody] GitRepositoryReference gitRepositoryReference)
{
if (!ModelState.IsValid)
{
return HttpBadRequest(ModelState);
}
if (id != gitRepositoryReference.Path)
{
return HttpBadRequest();
}
_context.Entry(gitRepositoryReference).State = EntityState.Modified;
try
{
await _context.SaveChangesAsync();
}
catch (DbUpdateConcurrencyException)
{
if (!GitRepositoryReferenceExists(id))
{
return HttpNotFound();
}
else
{
throw;
}
}
return new HttpStatusCodeResult(StatusCodes.Status204NoContent);
}
// POST: api/GitRefsApi
[HttpPost]
public async Task<IActionResult> PostGitRepositoryReference([FromBody] GitRepositoryReference gitRepositoryReference)
{
if (!ModelState.IsValid)
{
return HttpBadRequest(ModelState);
}
_context.GitRepositoryReference.Add(gitRepositoryReference);
try
{
await _context.SaveChangesAsync();
}
catch (DbUpdateException)
{
if (GitRepositoryReferenceExists(gitRepositoryReference.Path))
{
return new HttpStatusCodeResult(StatusCodes.Status409Conflict);
}
else
{
throw;
}
}
return CreatedAtRoute("GetGitRepositoryReference", new { id = gitRepositoryReference.Path }, gitRepositoryReference);
}
// DELETE: api/GitRefsApi/5
[HttpDelete("{id}")]
public async Task<IActionResult> DeleteGitRepositoryReference([FromRoute] string id)
{
if (!ModelState.IsValid)
{
return HttpBadRequest(ModelState);
}
GitRepositoryReference gitRepositoryReference = await _context.GitRepositoryReference.SingleAsync(m => m.Path == id);
if (gitRepositoryReference == null)
{
return HttpNotFound();
}
_context.GitRepositoryReference.Remove(gitRepositoryReference);
await _context.SaveChangesAsync();
return Ok(gitRepositoryReference);
}
protected override void Dispose(bool disposing)
{
if (disposing)
{
_context.Dispose();
}
base.Dispose(disposing);
}
private bool GitRepositoryReferenceExists(string id)
{
return _context.GitRepositoryReference.Count(e => e.Path == id) > 0;
}
}
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,783 @@
using System;
using System.Collections.Generic;
using Microsoft.Data.Entity.Migrations;
using Yavsc.Models;
using Yavsc.Models.Relationship;
namespace Yavsc.Migrations
{
public partial class gitrefs : 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_BlackListed_ApplicationUser_OwnerId", 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_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_DimissClicked_ApplicationUser_UserId", table: "DimissClicked");
migrationBuilder.DropForeignKey(name: "FK_Instrumentation_Instrument_InstrumentId", table: "Instrumentation");
migrationBuilder.DropForeignKey(name: "FK_PayPalPayment_ApplicationUser_ExecutorId", table: "PayPalPayment");
migrationBuilder.DropForeignKey(name: "FK_CircleMember_Circle_CircleId", table: "CircleMember");
migrationBuilder.DropForeignKey(name: "FK_CircleMember_ApplicationUser_MemberId", table: "CircleMember");
migrationBuilder.DropForeignKey(name: "FK_CommandForm_Activity_ActivityCode", table: "CommandForm");
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_LocationType_LocationTypeId", table: "RdvQuery");
migrationBuilder.DropForeignKey(name: "FK_RdvQuery_PerformerProfile_PerformerId", table: "RdvQuery");
migrationBuilder.DropForeignKey(name: "FK_UserActivity_Activity_DoesCode", table: "UserActivity");
migrationBuilder.DropForeignKey(name: "FK_UserActivity_PerformerProfile_UserId", table: "UserActivity");
migrationBuilder.DropColumn(name: "LocationTypeId", table: "RdvQuery");
migrationBuilder.DropTable("LocationType");
migrationBuilder.CreateTable(
name: "GitRepositoryReference",
columns: table => new
{
Path = table.Column<string>(nullable: false),
Url = table.Column<string>(nullable: false),
Branch = table.Column<string>(nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_GitRepositoryReference", x => new { x.Path, x.Url, x.Branch });
});
migrationBuilder.AddColumn<int>(
name: "LocationType",
table: "RdvQuery",
nullable: false,
defaultValue: LocationKind.PostalAddress);
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_BlackListed_ApplicationUser_OwnerId",
table: "BlackListed",
column: "OwnerId",
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_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_DimissClicked_ApplicationUser_UserId",
table: "DimissClicked",
column: "UserId",
principalTable: "AspNetUsers",
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_PayPalPayment_ApplicationUser_ExecutorId",
table: "PayPalPayment",
column: "ExecutorId",
principalTable: "AspNetUsers",
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_CircleMember_ApplicationUser_MemberId",
table: "CircleMember",
column: "MemberId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_CommandForm_Activity_ActivityCode",
table: "CommandForm",
column: "ActivityCode",
principalTable: "Activity",
principalColumn: "Code",
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_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_BlackListed_ApplicationUser_OwnerId", 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_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_DimissClicked_ApplicationUser_UserId", table: "DimissClicked");
migrationBuilder.DropForeignKey(name: "FK_Instrumentation_Instrument_InstrumentId", table: "Instrumentation");
migrationBuilder.DropForeignKey(name: "FK_PayPalPayment_ApplicationUser_ExecutorId", table: "PayPalPayment");
migrationBuilder.DropForeignKey(name: "FK_CircleMember_Circle_CircleId", table: "CircleMember");
migrationBuilder.DropForeignKey(name: "FK_CircleMember_ApplicationUser_MemberId", table: "CircleMember");
migrationBuilder.DropForeignKey(name: "FK_CommandForm_Activity_ActivityCode", table: "CommandForm");
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_UserActivity_Activity_DoesCode", table: "UserActivity");
migrationBuilder.DropForeignKey(name: "FK_UserActivity_PerformerProfile_UserId", table: "UserActivity");
migrationBuilder.DropColumn(name: "LocationType", table: "RdvQuery");
migrationBuilder.DropTable("GitRepositoryReference");
migrationBuilder.CreateTable(
name: "LocationType",
columns: table => new
{
Id = table.Column<long>(nullable: false)
.Annotation("Npgsql:Serial", true),
Name = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_LocationType", x => x.Id);
});
migrationBuilder.AddColumn<long>(
name: "LocationTypeId",
table: "RdvQuery",
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_BlackListed_ApplicationUser_OwnerId",
table: "BlackListed",
column: "OwnerId",
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_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_DimissClicked_ApplicationUser_UserId",
table: "DimissClicked",
column: "UserId",
principalTable: "AspNetUsers",
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_PayPalPayment_ApplicationUser_ExecutorId",
table: "PayPalPayment",
column: "ExecutorId",
principalTable: "AspNetUsers",
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_CircleMember_ApplicationUser_MemberId",
table: "CircleMember",
column: "MemberId",
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_CommandForm_Activity_ActivityCode",
table: "CommandForm",
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);
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_LocationType_LocationTypeId",
table: "RdvQuery",
column: "LocationTypeId",
principalTable: "LocationType",
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_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);
}
}
}

@ -1128,16 +1128,6 @@ namespace Yavsc.Migrations
b.HasKey("Id");
});
modelBuilder.Entity("Yavsc.Models.Relationship.LocationType", b =>
{
b.Property<long>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name");
b.HasKey("Id");
});
modelBuilder.Entity("Yavsc.Models.Relationship.Tag", b =>
{
b.Property<long>("Id")
@ -1282,7 +1272,7 @@ namespace Yavsc.Migrations
b.Property<long?>("LocationId");
b.Property<long?>("LocationTypeId");
b.Property<int>("LocationType");
b.Property<string>("PaymentId");
@ -1347,6 +1337,17 @@ namespace Yavsc.Migrations
b.HasKey("Id");
});
modelBuilder.Entity("Yavsc.Server.Models.IT.SourceCode.GitRepositoryReference", b =>
{
b.Property<string>("Path");
b.Property<string>("Url");
b.Property<string>("Branch");
b.HasKey("Path", "Url", "Branch");
});
modelBuilder.Entity("Microsoft.AspNet.Identity.EntityFramework.IdentityRoleClaim<string>", b =>
{
b.HasOne("Microsoft.AspNet.Identity.EntityFramework.IdentityRole")
@ -1776,10 +1777,6 @@ namespace Yavsc.Migrations
.WithMany()
.HasForeignKey("LocationId");
b.HasOne("Yavsc.Models.Relationship.LocationType")
.WithMany()
.HasForeignKey("LocationTypeId");
b.HasOne("Yavsc.Models.Payment.PayPalPayment")
.WithMany()
.HasForeignKey("PaymentId");

@ -10,6 +10,7 @@ using Yavsc.Models.Haircut;
using Yavsc.Models.IT.Maintaining;
using Yavsc.Models.IT.Fixing;
using Yavsc.Server.Models.EMailing;
using Yavsc.Server.Models.IT.SourceCode;
namespace Yavsc.Models
{
@ -65,7 +66,9 @@ namespace Yavsc.Models
if (et.ClrType.GetInterface("IBaseTrackedEntity")!=null)
et.FindProperty("DateCreated").IsReadOnlyAfterSave = true;
}
builder.Entity<GitRepositoryReference>().HasKey(r => new { r.Path, r.Url, r.Branch });
}
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
optionsBuilder.UseNpgsql(DbHelpers.ConnectionString);
@ -299,5 +302,7 @@ namespace Yavsc.Models
public DbSet<MailingTemplate> MailingTemplate { get; set; }
public DbSet<GitRepositoryReference> GitRepositoryReference { get; set; }
}
}

@ -14,7 +14,7 @@
<div class="form-group">
<label asp-for="Body" class="col-md-2 control-label"></label>
<div class="col-md-10">
<input asp-for="Body" class="form-control" />
<textarea asp-for="Body" class="form-control" />
<span asp-validation-for="Body" class="text-danger" />
</div>
</div>
@ -32,10 +32,10 @@
</div>
</div>
<div class="form-group">
<label asp-for="ShortName" class="col-md-2 control-label"></label>
<label asp-for="Topic" class="col-md-2 control-label"></label>
<div class="col-md-10">
<input asp-for="ShortName" class="form-control" />
<span asp-validation-for="ShortName" class="text-danger" />
<input asp-for="Topic" class="form-control" />
<span asp-validation-for="Topic" class="text-danger" />
</div>
</div>
<div class="form-group">

@ -36,7 +36,7 @@
@Html.DisplayFor(model => model.ReplyToAddress)
</dd>
<dt>
@Html.DisplayNameFor(model => model.ShortName)
@Html.DisplayNameFor(model => model.Topic)
</dt>
<dd>
@Html.DisplayFor(model => model.ShortName)

@ -3,6 +3,9 @@
@{
ViewData["Title"] = "Details";
}
@section scripts {
<script src="https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js"></script>
}
<h2>Details</h2>
@ -14,7 +17,7 @@
@Html.DisplayNameFor(model => model.Body)
</dt>
<dd>
@Html.DisplayFor(model => model.Body)
<code><pre class="prettyprint">@Model.Body</pre></code>
</dd>
<dt>
@Html.DisplayNameFor(model => model.DateCreated)
@ -35,10 +38,10 @@
@Html.DisplayFor(model => model.ReplyToAddress)
</dd>
<dt>
@Html.DisplayNameFor(model => model.ShortName)
@Html.DisplayNameFor(model => model.Topic)
</dt>
<dd>
@Html.DisplayFor(model => model.ShortName)
@Html.DisplayFor(model => model.Topic)
</dd>
<dt>
@Html.DisplayNameFor(model => model.ToSend)

@ -15,7 +15,7 @@
<div class="form-group">
<label asp-for="Body" class="col-md-2 control-label"></label>
<div class="col-md-10">
<input asp-for="Body" class="form-control" />
<textarea asp-for="Body" class="form-control" />
<span asp-validation-for="Body" class="text-danger" ></span>
</div>
</div>
@ -35,10 +35,10 @@
</div>
</div>
<div class="form-group">
<label asp-for="ShortName" class="col-md-2 control-label"></label>
<label asp-for="Topic" class="col-md-2 control-label"></label>
<div class="col-md-10">
<input asp-for="ShortName" class="form-control" />
<span asp-validation-for="ShortName" class="text-danger" ></span>
<input asp-for="Topic" class="form-control" />
<span asp-validation-for="Topic" class="text-danger" ></span>
</div>
</div>
<div class="form-group">

Loading…