dropping GCM support
This commit is contained in:
@ -8,9 +8,11 @@ namespace Yavsc.Abstract.Chat
|
||||
[RegularExpression(@"^#?[a-zA-Z0-9'-']{3,10}$", ErrorMessage = "chan name cannot be validated.")]
|
||||
string Name { get; }
|
||||
|
||||
[RegularExpression(@"^#?[a-zA-Z0-9'-']{3,10}$", ErrorMessage = "topic cannot be validated.")]
|
||||
[RegularExpression(@"^#?[a-zA-Z0-9'-']{3,255}$", ErrorMessage = "topic cannot be validated.")]
|
||||
string Topic { get ; set; }
|
||||
|
||||
List<TMod> Administration { get; }
|
||||
string OwnerId { get ; }
|
||||
|
||||
List<TMod> Moderation { get; }
|
||||
}
|
||||
}
|
@ -1,9 +1,8 @@
|
||||
namespace Yavsc.Abstract.Streaming
|
||||
namespace Yavsc.Abstract.Chat
|
||||
{
|
||||
|
||||
public interface IChatUserInfo
|
||||
{
|
||||
IConnection[] Connections { get; set; }
|
||||
string UserId { get; set; }
|
||||
|
||||
string UserName { get; set; }
|
||||
|
@ -1,9 +1,7 @@
|
||||
namespace Yavsc
|
||||
{
|
||||
using Abstract.Identity;
|
||||
public interface IContact
|
||||
{
|
||||
IApplicationUser Owner { get; set; }
|
||||
string OwnerId { get; set; }
|
||||
string UserId { get; set; }
|
||||
}
|
||||
|
@ -20,10 +20,9 @@ using System;
|
||||
|
||||
namespace Yavsc
|
||||
{
|
||||
public interface IGCMDeclaration
|
||||
public interface IMobileDeviceDeclaration
|
||||
{
|
||||
string DeviceId { get; set; }
|
||||
string GCMRegistrationId { get; set; }
|
||||
string Model { get; set; }
|
||||
string Platform { get; set; }
|
||||
string Version { get; set; }
|
@ -34,6 +34,8 @@ namespace Yavsc
|
||||
DefaultAvatar = "/images/Users/icon_user.png",
|
||||
AnonAvatar = "/images/Users/icon_anon_user.png",
|
||||
YavscConnectionStringEnvName = "YAVSC_DB_CONNECTION";
|
||||
|
||||
|
||||
|
||||
public static readonly long DefaultFSQ = 1024*1024*500;
|
||||
|
||||
@ -55,5 +57,7 @@ namespace Yavsc
|
||||
{ "openid", "profile", "email", "https://www.googleapis.com/auth/calendar" };
|
||||
|
||||
public static readonly string NoneCode = "none";
|
||||
|
||||
public const int MaxChanelName = 255;
|
||||
}
|
||||
}
|
||||
|
@ -8,10 +8,10 @@ using Yavsc.Models.Messaging;
|
||||
|
||||
namespace Yavsc.Services
|
||||
{
|
||||
public interface IGoogleCloudMessageSender
|
||||
public interface IYavscMessageSender
|
||||
{
|
||||
Task<MessageWithPayloadResponse> NotifyBookQueryAsync(
|
||||
IEnumerable<string> registrationId,
|
||||
IEnumerable<string> DeviceIds,
|
||||
RdvQueryEvent ev);
|
||||
|
||||
Task<MessageWithPayloadResponse> NotifyEstimateAsync(
|
||||
|
@ -57,7 +57,7 @@ namespace Yavsc.Models
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
[InverseProperty("DeviceOwner"),JsonIgnore]
|
||||
public virtual List<GoogleCloudMobileDeclaration> Devices { get; set; }
|
||||
public virtual List<DeviceDeclaration> DeviceDeclarations { get; set; }
|
||||
|
||||
[InverseProperty("Owner"),JsonIgnore]
|
||||
public virtual List<ChatConnection> Connections { get; set; }
|
||||
@ -101,5 +101,12 @@ namespace Yavsc.Models
|
||||
public virtual List<BlackListed> BlackList { get; set; }
|
||||
|
||||
public bool AllowMonthlyEmail { get; set; } = false;
|
||||
|
||||
[JsonIgnore][InverseProperty("Owner")]
|
||||
public virtual List<ChatRoom> Rooms { get; set; }
|
||||
|
||||
[JsonIgnore][InverseProperty("User")]
|
||||
public virtual List<ChatRoomAccess> RoomAccess { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Newtonsoft.Json;
|
||||
@ -7,10 +7,8 @@ namespace Yavsc.Models.Identity
|
||||
{
|
||||
[JsonObject]
|
||||
|
||||
public class GoogleCloudMobileDeclaration : IGCMDeclaration {
|
||||
public class DeviceDeclaration : IMobileDeviceDeclaration {
|
||||
|
||||
[Required]
|
||||
public string GCMRegistrationId { get; set; }
|
||||
|
||||
[Key,Required]
|
||||
public string DeviceId { get; set; }
|
@ -20,7 +20,6 @@
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
@ -41,9 +40,6 @@ namespace Yavsc.Models.Chat
|
||||
|
||||
public bool Connected { get; set; }
|
||||
|
||||
[InverseProperty("ChatUserConnection")]
|
||||
public virtual List<ChatRoomPresence> Rooms { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -2,26 +2,25 @@
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Abstract.Streaming;
|
||||
using Yavsc.Abstract.Chat;
|
||||
|
||||
namespace Yavsc.Models.Chat
|
||||
{
|
||||
public class ChatRoom: IChatRoom<ChatRoomPresence>
|
||||
public class ChatRoom: IChatRoom<ChatRoomAccess>
|
||||
{
|
||||
[StringLengthAttribute(1023,MinimumLength=1)]
|
||||
public string Topic { get; set; }
|
||||
|
||||
[Key]
|
||||
[StringLengthAttribute(255,MinimumLength=1)]
|
||||
[StringLengthAttribute(Constants.MaxChanelName, MinimumLength=3)]
|
||||
public string Name { get; set;}
|
||||
|
||||
public string ApplicationUserId { get; set; }
|
||||
public string OwnerId { get; set; }
|
||||
|
||||
[ForeignKey("ApplicationUserId")]
|
||||
[ForeignKey("OwnerId")]
|
||||
public virtual ApplicationUser Owner { get; set; }
|
||||
|
||||
[InverseProperty("Room")]
|
||||
public virtual List<ChatRoomPresence> UserList { get; set;}
|
||||
public virtual List<ChatRoomAccess> Moderation { get; set; }
|
||||
|
||||
}
|
||||
}
|
33
src/Yavsc.Server/Models/Chat/ChatRoomAccess.cs
Normal file
33
src/Yavsc.Server/Models/Chat/ChatRoomAccess.cs
Normal file
@ -0,0 +1,33 @@
|
||||
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Abstract.Chat;
|
||||
|
||||
namespace Yavsc.Models.Chat
|
||||
{
|
||||
public class ChatRoomAccess: IChatRoomAccess
|
||||
{
|
||||
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public string ChannelName { get; set; }
|
||||
[ForeignKey("ChannelName")]
|
||||
public virtual ChatRoom Room { get; set; }
|
||||
|
||||
[Required]
|
||||
public string UserId { get; set; }
|
||||
|
||||
public ChatRoomAccessLevel Level
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
|
||||
|
||||
[ForeignKey("UserId")]
|
||||
public virtual ApplicationUser User { get; set; }
|
||||
}
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Yavsc.Abstract.Streaming;
|
||||
|
||||
namespace Yavsc.Models.Chat
|
||||
{
|
||||
public class ChatRoomPresence: IChatRoomUsage
|
||||
{
|
||||
public string ChannelName { get; set; }
|
||||
[ForeignKey("ChannelName")]
|
||||
public virtual ChatRoom Room { get; set; }
|
||||
|
||||
public string ChatUserConnectionId { get; set; }
|
||||
|
||||
[ForeignKey("ChatUserConnectionId")]
|
||||
public virtual ChatConnection ChatUserConnection { get; set; }
|
||||
|
||||
public ChatRoomUsageLevel Level
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
}
|
||||
}
|
@ -17,7 +17,6 @@ namespace Yavsc.Server.Models.EMailing
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public DateTime DateModified
|
||||
{
|
||||
get;
|
||||
@ -44,12 +43,24 @@ namespace Yavsc.Server.Models.EMailing
|
||||
public virtual ApplicationUser Manager { get; set; }
|
||||
|
||||
public Periodicity ToSend { get; set; }
|
||||
|
||||
[Required]
|
||||
public string ManagerId
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[Required]
|
||||
public string SuccessorId
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
[ForeignKey("SuccessorId")]
|
||||
public virtual ApplicationUser Successor { get; set; }
|
||||
|
||||
public string UserCreated
|
||||
{
|
||||
get;
|
||||
|
@ -4,7 +4,7 @@ using Newtonsoft.Json;
|
||||
|
||||
namespace Yavsc.Models.Relationship
|
||||
{
|
||||
public class Contact
|
||||
public class Contact: IContact
|
||||
{
|
||||
[Required()]
|
||||
public string UserId { get; set; }
|
||||
@ -15,7 +15,10 @@ namespace Yavsc.Models.Relationship
|
||||
public string Name { get; set; }
|
||||
public string EMail { get; set; }
|
||||
|
||||
public PostalAddress PostalAddress { get; set; }
|
||||
public long AddressId { get ; set; }
|
||||
|
||||
[ForeignKey("AddressId")]
|
||||
public virtual PostalAddress PostalAddress { get; set; }
|
||||
|
||||
|
||||
[ForeignKeyAttribute("OwnerId"),NotMapped]
|
||||
|
@ -1,14 +1,21 @@
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
|
||||
namespace Yavsc.Models.Relationship
|
||||
{
|
||||
/// <summary>
|
||||
/// Well defined postal adress
|
||||
/// </summary>
|
||||
public class PostalAddress
|
||||
{
|
||||
public string Street1 { get; set; }
|
||||
public string Street2 { get; set; }
|
||||
public string PostalCode { get; set; }
|
||||
public string City { get; set; }
|
||||
public string State { get; set; }
|
||||
public string Province { get; set; }
|
||||
|
||||
|
||||
[Key(), DatabaseGenerated(DatabaseGeneratedOption.Identity)]
|
||||
public long Id { get; set; }
|
||||
public string Street1 { get; set; }
|
||||
public string Street2 { get; set; }
|
||||
public string PostalCode { get; set; }
|
||||
public string City { get; set; }
|
||||
public string State { get; set; }
|
||||
public string Province { get; set; }
|
||||
public string Country { get; set; }
|
||||
}
|
||||
}
|
@ -1,9 +0,0 @@
|
||||
using Yavsc.Models.Relationship;
|
||||
|
||||
namespace Yavsc
|
||||
{
|
||||
public class OupsContact
|
||||
{
|
||||
}
|
||||
|
||||
}
|
@ -29,7 +29,7 @@ namespace Yavsc.ApiControllers
|
||||
ApplicationDbContext dbContext;
|
||||
private IStringLocalizer _localizer;
|
||||
private GoogleAuthSettings _googleSettings;
|
||||
private IGoogleCloudMessageSender _GCMSender;
|
||||
private IYavscMessageSender _GCMSender;
|
||||
private IAuthorizationService authorizationService;
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ namespace Yavsc.ApiControllers
|
||||
IStringLocalizer<Yavsc.Resources.YavscLocalisation> SR,
|
||||
ApplicationDbContext context,
|
||||
IOptions<GoogleAuthSettings> googleSettings,
|
||||
IGoogleCloudMessageSender GCMSender,
|
||||
IYavscMessageSender GCMSender,
|
||||
IBillingService billingService
|
||||
)
|
||||
{
|
||||
@ -108,7 +108,7 @@ namespace Yavsc.ApiControllers
|
||||
public async Task<IActionResult> ProSign(string billingCode, long id)
|
||||
{
|
||||
var estimate = dbContext.Estimates.
|
||||
Include(e=>e.Client).Include(e=>e.Client.Devices)
|
||||
Include(e=>e.Client).Include(e=>e.Client.DeviceDeclarations)
|
||||
.Include(e=>e.Bill).Include(e=>e.Owner).Include(e=>e.Owner.Performer)
|
||||
.FirstOrDefault(e=>e.Id == id);
|
||||
if (estimate == null)
|
||||
@ -127,7 +127,7 @@ namespace Yavsc.ApiControllers
|
||||
|
||||
var yaev = new EstimationEvent(estimate,_localizer);
|
||||
|
||||
var regids = estimate.Client.Devices.Select(d => d.GCMRegistrationId).ToArray();
|
||||
var regids = estimate.Client.DeviceDeclarations.Select(d => d.DeviceId).ToArray();
|
||||
bool gcmSent = false;
|
||||
if (regids.Length>0) {
|
||||
var grep = await _GCMSender.NotifyEstimateAsync(regids,yaev);
|
||||
|
@ -29,7 +29,7 @@ namespace Yavsc.ApiControllers
|
||||
{
|
||||
private ApplicationDbContext _context;
|
||||
private IEmailSender _emailSender;
|
||||
private IGoogleCloudMessageSender _GCMSender;
|
||||
private IYavscMessageSender _GCMSender;
|
||||
private GoogleAuthSettings _googleSettings;
|
||||
private IStringLocalizer<YavscLocalisation> _localizer;
|
||||
private ILogger _logger;
|
||||
@ -40,7 +40,7 @@ namespace Yavsc.ApiControllers
|
||||
PayPalSettings _paymentSettings;
|
||||
public HairCutController(ApplicationDbContext context,
|
||||
IOptions<GoogleAuthSettings> googleSettings,
|
||||
IGoogleCloudMessageSender GCMSender,
|
||||
IYavscMessageSender GCMSender,
|
||||
UserManager<ApplicationUser> userManager,
|
||||
IStringLocalizer<Yavsc.Resources.YavscLocalisation> localizer,
|
||||
IEmailSender emailSender,
|
||||
|
@ -1,4 +1,4 @@
|
||||
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Security.Claims;
|
||||
@ -9,15 +9,15 @@ using Yavsc.Models;
|
||||
using Yavsc.Models.Identity;
|
||||
|
||||
[Authorize, Route("~/api/gcm")]
|
||||
public class GCMController : Controller
|
||||
public class NativeConfidentialController : Controller
|
||||
{
|
||||
ILogger _logger;
|
||||
ApplicationDbContext _context;
|
||||
|
||||
public GCMController(ApplicationDbContext context,
|
||||
public NativeConfidentialController(ApplicationDbContext context,
|
||||
ILoggerFactory loggerFactory)
|
||||
{
|
||||
_logger = loggerFactory.CreateLogger<GCMController>();
|
||||
_logger = loggerFactory.CreateLogger<NativeConfidentialController>();
|
||||
_context = context;
|
||||
}
|
||||
/// <summary>
|
||||
@ -28,7 +28,7 @@ public class GCMController : Controller
|
||||
/// <returns></returns>
|
||||
[Authorize, HttpPost("register")]
|
||||
public IActionResult Register(
|
||||
[FromBody] GoogleCloudMobileDeclaration declaration)
|
||||
[FromBody] DeviceDeclaration declaration)
|
||||
{
|
||||
var uid = User.GetUserId();
|
||||
|
||||
@ -40,15 +40,13 @@ public class GCMController : Controller
|
||||
declaration.LatestActivityUpdate = DateTime.Now;
|
||||
|
||||
_logger.LogInformation($"Registering device with id:{declaration.DeviceId} for {uid}");
|
||||
var alreadyRegisteredDevice = _context.GCMDevices.FirstOrDefault(d => d.DeviceId == declaration.DeviceId);
|
||||
var alreadyRegisteredDevice = _context.DeviceDeclaration.FirstOrDefault(d => d.DeviceId == declaration.DeviceId);
|
||||
var deviceAlreadyRegistered = (alreadyRegisteredDevice!=null);
|
||||
if (deviceAlreadyRegistered)
|
||||
{
|
||||
_logger.LogInformation($"deviceAlreadyRegistered");
|
||||
// Override an exiting owner
|
||||
alreadyRegisteredDevice.DeclarationDate = DateTime.Now;
|
||||
alreadyRegisteredDevice.DeviceOwnerId = uid;
|
||||
alreadyRegisteredDevice.GCMRegistrationId = declaration.GCMRegistrationId;
|
||||
alreadyRegisteredDevice.Model = declaration.Model;
|
||||
alreadyRegisteredDevice.Platform = declaration.Platform;
|
||||
alreadyRegisteredDevice.Version = declaration.Version;
|
||||
@ -60,7 +58,7 @@ public class GCMController : Controller
|
||||
_logger.LogInformation($"new device");
|
||||
declaration.DeclarationDate = DateTime.Now;
|
||||
declaration.DeviceOwnerId = uid;
|
||||
_context.GCMDevices.Add(declaration as GoogleCloudMobileDeclaration);
|
||||
_context.DeviceDeclaration.Add(declaration as DeviceDeclaration);
|
||||
_context.SaveChanges(User.GetUserId());
|
||||
}
|
||||
var latestActivityUpdate = _context.Activities.Max(a=>a.DateModified);
|
@ -708,9 +708,13 @@ namespace Yavsc.Controllers
|
||||
async Task<IdentityResult> DeleteUser(string userId)
|
||||
{
|
||||
ApplicationUser user = await _userManager.FindByIdAsync(userId);
|
||||
_dbContext.GCMDevices.RemoveRange( _dbContext.GCMDevices.Where(g => g.DeviceOwnerId == userId ));
|
||||
// TODO add an owner to maillings
|
||||
_dbContext.MailingTemplate.RemoveRange(_dbContext.MailingTemplate.Where( t=>t.ManagerId == userId ));
|
||||
|
||||
_dbContext.DeviceDeclaration.RemoveRange( _dbContext.DeviceDeclaration.Where(g => g.DeviceOwnerId == userId ));
|
||||
|
||||
foreach (var template in _dbContext.MailingTemplate.Where( t=>t.ManagerId == userId ))
|
||||
{
|
||||
template.ManagerId = template.SuccessorId;
|
||||
}
|
||||
|
||||
return await _userManager.DeleteAsync(user);
|
||||
}
|
||||
|
@ -12,7 +12,6 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Extensions.Localization;
|
||||
using Yavsc.Models.Workflow;
|
||||
using Yavsc.Models.Identity;
|
||||
|
||||
namespace Yavsc.Controllers
|
||||
{
|
||||
@ -39,7 +38,7 @@ namespace Yavsc.Controllers
|
||||
private GoogleAuthSettings _googleSettings;
|
||||
|
||||
private PayPalSettings _payPalSettings;
|
||||
private IGoogleCloudMessageSender _GCMSender;
|
||||
private IYavscMessageSender _GCMSender;
|
||||
private SIRENChecker _cchecker;
|
||||
private IStringLocalizer _SR;
|
||||
private CompanyInfoSettings _cinfoSettings;
|
||||
@ -51,7 +50,7 @@ namespace Yavsc.Controllers
|
||||
UserManager<ApplicationUser> userManager,
|
||||
SignInManager<ApplicationUser> signInManager,
|
||||
IEmailSender emailSender,
|
||||
IGoogleCloudMessageSender GCMSender,
|
||||
IYavscMessageSender GCMSender,
|
||||
IOptions<SiteSettings> siteSettings,
|
||||
IOptions<GoogleAuthSettings> googleSettings,
|
||||
IOptions<PayPalSettings> paypalSettings,
|
||||
@ -292,11 +291,6 @@ namespace Yavsc.Controllers
|
||||
{
|
||||
return View();
|
||||
}
|
||||
[HttpGet]
|
||||
public IActionResult AddMobileApp(GoogleCloudMobileDeclaration model)
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public async Task<IActionResult> SetGoogleCalendar(string returnUrl, string pageToken)
|
||||
|
@ -1,4 +1,4 @@
|
||||
using System.Linq;
|
||||
using System.Linq;
|
||||
using System.Security.Claims;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
@ -10,12 +10,11 @@ namespace Yavsc.Controllers
|
||||
{
|
||||
using Models;
|
||||
using Models.Identity;
|
||||
|
||||
public class GCMDevicesController : Controller
|
||||
public class DevicesController : Controller
|
||||
{
|
||||
private ApplicationDbContext _context;
|
||||
|
||||
public GCMDevicesController(ApplicationDbContext context)
|
||||
public DevicesController(ApplicationDbContext context)
|
||||
{
|
||||
_context = context;
|
||||
}
|
||||
@ -25,7 +24,7 @@ namespace Yavsc.Controllers
|
||||
{
|
||||
var uid = User.GetUserId();
|
||||
|
||||
var applicationDbContext = _context.GCMDevices.Include(g => g.DeviceOwner).Where(d=>d.DeviceOwnerId == uid);
|
||||
var applicationDbContext = _context.DeviceDeclaration.Include(g => g.DeviceOwner).Where(d=>d.DeviceOwnerId == uid);
|
||||
return View(await applicationDbContext.ToListAsync());
|
||||
}
|
||||
|
||||
@ -37,7 +36,7 @@ namespace Yavsc.Controllers
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
GoogleCloudMobileDeclaration googleCloudMobileDeclaration = await _context.GCMDevices.SingleAsync(m => m.DeviceId == id);
|
||||
DeviceDeclaration googleCloudMobileDeclaration = await _context.DeviceDeclaration.SingleAsync(m => m.DeviceId == id);
|
||||
if (googleCloudMobileDeclaration == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
@ -55,7 +54,7 @@ namespace Yavsc.Controllers
|
||||
return HttpNotFound();
|
||||
}
|
||||
|
||||
GoogleCloudMobileDeclaration googleCloudMobileDeclaration = await _context.GCMDevices.SingleAsync(m => m.DeviceId == id);
|
||||
DeviceDeclaration googleCloudMobileDeclaration = await _context.DeviceDeclaration.SingleAsync(m => m.DeviceId == id);
|
||||
if (googleCloudMobileDeclaration == null)
|
||||
{
|
||||
return HttpNotFound();
|
||||
@ -69,8 +68,8 @@ namespace Yavsc.Controllers
|
||||
[ValidateAntiForgeryToken]
|
||||
public async Task<IActionResult> DeleteConfirmed(string id)
|
||||
{
|
||||
GoogleCloudMobileDeclaration googleCloudMobileDeclaration = await _context.GCMDevices.SingleAsync(m => m.DeviceId == id);
|
||||
_context.GCMDevices.Remove(googleCloudMobileDeclaration);
|
||||
DeviceDeclaration googleCloudMobileDeclaration = await _context.DeviceDeclaration.SingleAsync(m => m.DeviceId == id);
|
||||
_context.DeviceDeclaration.Remove(googleCloudMobileDeclaration);
|
||||
await _context.SaveChangesAsync();
|
||||
return RedirectToAction("Index");
|
||||
}
|
@ -24,7 +24,7 @@ namespace Yavsc.Controllers
|
||||
protected UserManager<ApplicationUser> _userManager;
|
||||
protected ApplicationDbContext _context;
|
||||
protected GoogleAuthSettings _googleSettings;
|
||||
protected IGoogleCloudMessageSender _GCMSender;
|
||||
protected IYavscMessageSender _GCMSender;
|
||||
protected IEmailSender _emailSender;
|
||||
protected IStringLocalizer _localizer;
|
||||
protected SiteSettings _siteSettings;
|
||||
@ -34,7 +34,7 @@ namespace Yavsc.Controllers
|
||||
|
||||
protected readonly ILogger _logger;
|
||||
public CommandController(ApplicationDbContext context, IOptions<GoogleAuthSettings> googleSettings,
|
||||
IGoogleCloudMessageSender GCMSender,
|
||||
IYavscMessageSender GCMSender,
|
||||
UserManager<ApplicationUser> userManager,
|
||||
ICalendarManager calendarManager,
|
||||
IStringLocalizer<Yavsc.Resources.YavscLocalisation> localizer,
|
||||
@ -136,7 +136,7 @@ namespace Yavsc.Controllers
|
||||
);
|
||||
var pro = _context.Performers.Include(
|
||||
u => u.Performer
|
||||
).Include(u => u.Performer.Devices)
|
||||
).Include(u => u.Performer.DeviceDeclarations)
|
||||
.FirstOrDefault(
|
||||
x => x.PerformerId == command.PerformerId
|
||||
);
|
||||
@ -174,10 +174,10 @@ namespace Yavsc.Controllers
|
||||
try
|
||||
{
|
||||
_logger.LogInformation("sending GCM");
|
||||
if (pro.Performer.Devices.Count > 0)
|
||||
if (pro.Performer.DeviceDeclarations.Count > 0)
|
||||
{
|
||||
var regids = command.PerformerProfile.Performer
|
||||
.Devices.Select(d => d.GCMRegistrationId);
|
||||
.DeviceDeclarations.Select(d => d.DeviceId);
|
||||
grep = await _GCMSender.NotifyBookQueryAsync(regids, yaev);
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ namespace Yavsc.Controllers
|
||||
public HairCutCommandController(ApplicationDbContext context,
|
||||
IOptions<PayPalSettings> payPalSettings,
|
||||
IOptions<GoogleAuthSettings> googleSettings,
|
||||
IGoogleCloudMessageSender GCMSender,
|
||||
IYavscMessageSender GCMSender,
|
||||
UserManager<ApplicationUser> userManager,
|
||||
IStringLocalizer<Yavsc.Resources.YavscLocalisation> localizer,
|
||||
IEmailSender emailSender,
|
||||
@ -53,7 +53,7 @@ namespace Yavsc.Controllers
|
||||
.Include(x => x.PerformerProfile)
|
||||
.Include(x => x.Prestation)
|
||||
.Include(x => x.PerformerProfile.Performer)
|
||||
.Include(x => x.PerformerProfile.Performer.Devices)
|
||||
.Include(x => x.PerformerProfile.Performer.DeviceDeclarations)
|
||||
.Include(x => x.Regularisation)
|
||||
.SingleAsync(m => m.Id == id);
|
||||
query.SelectedProfile = await _context.BrusherProfile.SingleAsync(b => b.UserId == query.PerformerId);
|
||||
@ -100,11 +100,10 @@ namespace Yavsc.Controllers
|
||||
var yaev = command.CreatePaymentEvent(paymentInfo, _localizer);
|
||||
if (command.PerformerProfile.AcceptNotifications)
|
||||
{
|
||||
if (command.PerformerProfile.Performer.Devices.Count > 0)
|
||||
if (command.PerformerProfile.Performer.DeviceDeclarations.Count > 0)
|
||||
{
|
||||
var regids = command.PerformerProfile.Performer
|
||||
.Devices.Select(d => d.GCMRegistrationId);
|
||||
|
||||
.DeviceDeclarations.Select(d => d.DeviceId);
|
||||
grep = await _GCMSender.NotifyAsync(regids, yaev);
|
||||
}
|
||||
// TODO setup a profile choice to allow notifications
|
||||
@ -218,7 +217,7 @@ namespace Yavsc.Controllers
|
||||
_logger.LogInformation("le Model _est_ valide.");
|
||||
var pro = _context.Performers.Include(
|
||||
u => u.Performer
|
||||
).Include(u => u.Performer.Devices)
|
||||
).Include(u => u.Performer.DeviceDeclarations)
|
||||
.FirstOrDefault(
|
||||
x => x.PerformerId == model.PerformerId
|
||||
);
|
||||
@ -269,9 +268,9 @@ namespace Yavsc.Controllers
|
||||
{
|
||||
if (pro.AcceptNotifications)
|
||||
{
|
||||
if (pro.Performer.Devices.Count > 0)
|
||||
if (pro.Performer.DeviceDeclarations.Count > 0)
|
||||
{
|
||||
var regids = pro.Performer.Devices.Select(d => d.GCMRegistrationId);
|
||||
var regids = pro.Performer.DeviceDeclarations.Select(d => d.DeviceId);
|
||||
grep = await _GCMSender.NotifyHairCutQueryAsync(regids, yaev);
|
||||
}
|
||||
// TODO setup a profile choice to allow notifications
|
||||
@ -391,7 +390,7 @@ namespace Yavsc.Controllers
|
||||
);
|
||||
var pro = _context.Performers.Include(
|
||||
u => u.Performer
|
||||
).Include(u => u.Performer.Devices)
|
||||
).Include(u => u.Performer.DeviceDeclarations)
|
||||
.FirstOrDefault(
|
||||
x => x.PerformerId == command.PerformerId
|
||||
);
|
||||
@ -428,10 +427,10 @@ namespace Yavsc.Controllers
|
||||
if (pro.AcceptNotifications
|
||||
&& pro.AcceptPublicContact)
|
||||
{
|
||||
if (pro.Performer.Devices?.Count > 0)
|
||||
if (pro.Performer.DeviceDeclarations?.Count > 0)
|
||||
{
|
||||
var regids = command.PerformerProfile.Performer
|
||||
.Devices.Select(d => d.GCMRegistrationId);
|
||||
.DeviceDeclarations.Select(d => d.DeviceId);
|
||||
grep = await _GCMSender.NotifyHairCutQueryAsync(regids, yaev);
|
||||
}
|
||||
// TODO setup a profile choice to allow notifications
|
||||
|
@ -5,7 +5,6 @@ using Microsoft.AspNet.Diagnostics;
|
||||
using Microsoft.AspNet.Authorization;
|
||||
using Microsoft.AspNet.Hosting;
|
||||
using Microsoft.AspNet.Identity;
|
||||
using Microsoft.AspNet.Builder;
|
||||
using System.Linq;
|
||||
using System.Security.Claims;
|
||||
using Microsoft.Data.Entity;
|
||||
@ -93,7 +92,7 @@ namespace Yavsc.Controllers
|
||||
if (User.Identity.IsAuthenticated) {
|
||||
ViewBag.IsAuthenticated=true;
|
||||
string uid = User.GetUserId();
|
||||
ViewBag.Contacts = _dbContext.Contacts.Where(c=>c.OwnerId == uid)
|
||||
ViewBag.Contacts = _dbContext.Contact.Where(c=>c.OwnerId == uid)
|
||||
;
|
||||
} else ViewBag.IsAuthenticated=false;
|
||||
return View();
|
||||
|
@ -21,7 +21,7 @@ namespace Yavsc.Helpers
|
||||
.Include(p=>p.Activity)
|
||||
.Include(p=>p.Performer)
|
||||
.Include(p=>p.Performer.Posts)
|
||||
.Include(p=>p.Performer.Devices)
|
||||
.Include(p=>p.Performer.DeviceDeclarations)
|
||||
.Where(p => p.Active && p.Activity.Any(u=>u.DoesCode==actCode)).OrderBy( x => x.Rate )
|
||||
.ToArray();
|
||||
List<PerformerProfileViewModel> result = new List<PerformerProfileViewModel> ();
|
||||
|
2029
src/Yavsc/Migrations/20190507142752_chatAccess.Designer.cs
generated
Normal file
2029
src/Yavsc/Migrations/20190507142752_chatAccess.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
976
src/Yavsc/Migrations/20190507142752_chatAccess.cs
Normal file
976
src/Yavsc/Migrations/20190507142752_chatAccess.cs
Normal file
@ -0,0 +1,976 @@
|
||||
using System;
|
||||
using Microsoft.Data.Entity.Migrations;
|
||||
|
||||
namespace Yavsc.Migrations
|
||||
{
|
||||
public partial class chatAccess : 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_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_ChatRoom_ApplicationUser_ApplicationUserId", table: "ChatRoom");
|
||||
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_LiveFlow_ApplicationUser_OwnerId", table: "LiveFlow");
|
||||
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.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.DropColumn(name: "ApplicationUserId", table: "ChatRoom");
|
||||
migrationBuilder.DropTable("ChatRoomPresence");
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ChatRoomAccess",
|
||||
columns: table => new
|
||||
{
|
||||
ChannelName = table.Column<string>(nullable: false),
|
||||
UserId = table.Column<string>(nullable: false),
|
||||
Id = table.Column<long>(nullable: false)
|
||||
.Annotation("Npgsql:Serial", true),
|
||||
Level = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ChatRoomAccess", x => new { x.ChannelName, x.UserId });
|
||||
table.ForeignKey(
|
||||
name: "FK_ChatRoomAccess_ChatRoom_ChannelName",
|
||||
column: x => x.ChannelName,
|
||||
principalTable: "ChatRoom",
|
||||
principalColumn: "Name",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_ChatRoomAccess_ApplicationUser_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
migrationBuilder.CreateTable(
|
||||
name: "PostalAddress",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<long>(nullable: false)
|
||||
.Annotation("Npgsql:Serial", true),
|
||||
City = table.Column<string>(nullable: true),
|
||||
Country = table.Column<string>(nullable: true),
|
||||
PostalCode = table.Column<string>(nullable: true),
|
||||
Province = table.Column<string>(nullable: true),
|
||||
State = table.Column<string>(nullable: true),
|
||||
Street1 = table.Column<string>(nullable: true),
|
||||
Street2 = table.Column<string>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_PostalAddress", x => x.Id);
|
||||
});
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "EMail",
|
||||
table: "Contact",
|
||||
nullable: true);
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "Name",
|
||||
table: "Contact",
|
||||
nullable: true);
|
||||
migrationBuilder.AddColumn<long>(
|
||||
name: "PostalAddressId",
|
||||
table: "Contact",
|
||||
nullable: true);
|
||||
migrationBuilder.AlterColumn<DateTime>(
|
||||
name: "LatestActivityUpdate",
|
||||
table: "GoogleCloudMobileDeclaration",
|
||||
nullable: true);
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "OwnerId",
|
||||
table: "ChatRoom",
|
||||
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_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_ChatRoom_ApplicationUser_OwnerId",
|
||||
table: "ChatRoom",
|
||||
column: "OwnerId",
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
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_Contact_PostalAddress_PostalAddressId",
|
||||
table: "Contact",
|
||||
column: "PostalAddressId",
|
||||
principalTable: "PostalAddress",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_LiveFlow_ApplicationUser_OwnerId",
|
||||
table: "LiveFlow",
|
||||
column: "OwnerId",
|
||||
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);
|
||||
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_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_ChatRoom_ApplicationUser_OwnerId", table: "ChatRoom");
|
||||
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_Contact_PostalAddress_PostalAddressId", table: "Contact");
|
||||
migrationBuilder.DropForeignKey(name: "FK_LiveFlow_ApplicationUser_OwnerId", table: "LiveFlow");
|
||||
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.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.DropColumn(name: "EMail", table: "Contact");
|
||||
migrationBuilder.DropColumn(name: "Name", table: "Contact");
|
||||
migrationBuilder.DropColumn(name: "PostalAddressId", table: "Contact");
|
||||
migrationBuilder.DropColumn(name: "OwnerId", table: "ChatRoom");
|
||||
migrationBuilder.DropTable("ChatRoomAccess");
|
||||
migrationBuilder.DropTable("PostalAddress");
|
||||
migrationBuilder.CreateTable(
|
||||
name: "ChatRoomPresence",
|
||||
columns: table => new
|
||||
{
|
||||
ChannelName = table.Column<string>(nullable: false),
|
||||
ChatUserConnectionId = table.Column<string>(nullable: false),
|
||||
Level = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_ChatRoomPresence", x => new { x.ChannelName, x.ChatUserConnectionId });
|
||||
table.ForeignKey(
|
||||
name: "FK_ChatRoomPresence_ChatRoom_ChannelName",
|
||||
column: x => x.ChannelName,
|
||||
principalTable: "ChatRoom",
|
||||
principalColumn: "Name",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_ChatRoomPresence_ChatConnection_ChatUserConnectionId",
|
||||
column: x => x.ChatUserConnectionId,
|
||||
principalTable: "ChatConnection",
|
||||
principalColumn: "ConnectionId",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
migrationBuilder.AlterColumn<DateTime>(
|
||||
name: "LatestActivityUpdate",
|
||||
table: "GoogleCloudMobileDeclaration",
|
||||
nullable: false);
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "ApplicationUserId",
|
||||
table: "ChatRoom",
|
||||
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_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_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_ChatRoom_ApplicationUser_ApplicationUserId",
|
||||
table: "ChatRoom",
|
||||
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_LiveFlow_ApplicationUser_OwnerId",
|
||||
table: "LiveFlow",
|
||||
column: "OwnerId",
|
||||
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_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);
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
2034
src/Yavsc/Migrations/20190508004238_dropGCM.Designer.cs
generated
Normal file
2034
src/Yavsc/Migrations/20190508004238_dropGCM.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
982
src/Yavsc/Migrations/20190508004238_dropGCM.cs
Normal file
982
src/Yavsc/Migrations/20190508004238_dropGCM.cs
Normal file
@ -0,0 +1,982 @@
|
||||
using System;
|
||||
using Microsoft.Data.Entity.Migrations;
|
||||
|
||||
namespace Yavsc.Migrations
|
||||
{
|
||||
public partial class dropGCM : 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_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_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_Contact_PostalAddress_PostalAddressId", table: "Contact");
|
||||
migrationBuilder.DropForeignKey(name: "FK_LiveFlow_ApplicationUser_OwnerId", table: "LiveFlow");
|
||||
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.DropForeignKey(name: "FK_MailingTemplate_ApplicationUser_ManagerId", 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.DropColumn(name: "PostalAddressId", table: "Contact");
|
||||
migrationBuilder.DropTable("GoogleCloudMobileDeclaration");
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DeviceDeclaration",
|
||||
columns: table => new
|
||||
{
|
||||
DeviceId = table.Column<string>(nullable: false),
|
||||
DeclarationDate = table.Column<DateTime>(nullable: false, defaultValueSql: "LOCALTIMESTAMP"),
|
||||
DeviceOwnerId = table.Column<string>(nullable: true),
|
||||
LatestActivityUpdate = table.Column<DateTime>(nullable: true),
|
||||
Model = table.Column<string>(nullable: true),
|
||||
Platform = table.Column<string>(nullable: true),
|
||||
Version = table.Column<string>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_DeviceDeclaration", x => x.DeviceId);
|
||||
table.ForeignKey(
|
||||
name: "FK_DeviceDeclaration_ApplicationUser_DeviceOwnerId",
|
||||
column: x => x.DeviceOwnerId,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "ManagerId",
|
||||
table: "MailingTemplate",
|
||||
nullable: false);
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "SuccessorId",
|
||||
table: "MailingTemplate",
|
||||
nullable: true,
|
||||
defaultValue: "\"ManagerId\"");
|
||||
migrationBuilder.Sql("update \"MailingTemplate\" set \"SuccessorId\" = \"ManagerId\";");
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "SuccessorId",
|
||||
table: "MailingTemplate",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.AddColumn<long>(
|
||||
name: "AddressId",
|
||||
table: "Contact",
|
||||
nullable: false,
|
||||
defaultValue: 0L);
|
||||
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_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_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_Contact_PostalAddress_AddressId",
|
||||
table: "Contact",
|
||||
column: "AddressId",
|
||||
principalTable: "PostalAddress",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_LiveFlow_ApplicationUser_OwnerId",
|
||||
table: "LiveFlow",
|
||||
column: "OwnerId",
|
||||
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);
|
||||
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_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_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_Contact_PostalAddress_AddressId", table: "Contact");
|
||||
migrationBuilder.DropForeignKey(name: "FK_LiveFlow_ApplicationUser_OwnerId", table: "LiveFlow");
|
||||
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.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.DropColumn(name: "SuccessorId", table: "MailingTemplate");
|
||||
migrationBuilder.DropColumn(name: "AddressId", table: "Contact");
|
||||
migrationBuilder.DropTable("DeviceDeclaration");
|
||||
migrationBuilder.CreateTable(
|
||||
name: "GoogleCloudMobileDeclaration",
|
||||
columns: table => new
|
||||
{
|
||||
DeviceId = table.Column<string>(nullable: false),
|
||||
DeclarationDate = table.Column<DateTime>(nullable: false, defaultValueSql: "LOCALTIMESTAMP"),
|
||||
DeviceOwnerId = table.Column<string>(nullable: true),
|
||||
GCMRegistrationId = table.Column<string>(nullable: false),
|
||||
LatestActivityUpdate = table.Column<DateTime>(nullable: true),
|
||||
Model = table.Column<string>(nullable: true),
|
||||
Platform = table.Column<string>(nullable: true),
|
||||
Version = table.Column<string>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_GoogleCloudMobileDeclaration", x => x.DeviceId);
|
||||
table.ForeignKey(
|
||||
name: "FK_GoogleCloudMobileDeclaration_ApplicationUser_DeviceOwnerId",
|
||||
column: x => x.DeviceOwnerId,
|
||||
principalTable: "AspNetUsers",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "ManagerId",
|
||||
table: "MailingTemplate",
|
||||
nullable: true);
|
||||
migrationBuilder.AddColumn<long>(
|
||||
name: "PostalAddressId",
|
||||
table: "Contact",
|
||||
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_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_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_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_Contact_PostalAddress_PostalAddressId",
|
||||
table: "Contact",
|
||||
column: "PostalAddressId",
|
||||
principalTable: "PostalAddress",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_LiveFlow_ApplicationUser_OwnerId",
|
||||
table: "LiveFlow",
|
||||
column: "OwnerId",
|
||||
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_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);
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_MailingTemplate_ApplicationUser_ManagerId",
|
||||
table: "MailingTemplate",
|
||||
column: "ManagerId",
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
@ -1,6 +1,8 @@
|
||||
using System;
|
||||
using Microsoft.Data.Entity;
|
||||
using Microsoft.Data.Entity.Infrastructure;
|
||||
using Microsoft.Data.Entity.Metadata;
|
||||
using Microsoft.Data.Entity.Migrations;
|
||||
using Yavsc.Models;
|
||||
|
||||
namespace Yavsc.Migrations
|
||||
@ -544,23 +546,25 @@ namespace Yavsc.Migrations
|
||||
b.Property<string>("Name")
|
||||
.HasAnnotation("MaxLength", 255);
|
||||
|
||||
b.Property<string>("ApplicationUserId");
|
||||
b.Property<string>("OwnerId");
|
||||
|
||||
b.Property<string>("Topic")
|
||||
.HasAnnotation("MaxLength", 1023);
|
||||
b.Property<string>("Topic");
|
||||
|
||||
b.HasKey("Name");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Chat.ChatRoomPresence", b =>
|
||||
modelBuilder.Entity("Yavsc.Models.Chat.ChatRoomAccess", b =>
|
||||
{
|
||||
b.Property<string>("ChannelName");
|
||||
|
||||
b.Property<string>("ChatUserConnectionId");
|
||||
b.Property<string>("UserId");
|
||||
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<int>("Level");
|
||||
|
||||
b.HasKey("ChannelName", "ChatUserConnectionId");
|
||||
b.HasKey("ChannelName", "UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Cratie.Option", b =>
|
||||
@ -836,7 +840,7 @@ namespace Yavsc.Migrations
|
||||
b.HasKey("TaintId", "PrestationId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Identity.GoogleCloudMobileDeclaration", b =>
|
||||
modelBuilder.Entity("Yavsc.Models.Identity.DeviceDeclaration", b =>
|
||||
{
|
||||
b.Property<string>("DeviceId");
|
||||
|
||||
@ -846,10 +850,7 @@ namespace Yavsc.Migrations
|
||||
|
||||
b.Property<string>("DeviceOwnerId");
|
||||
|
||||
b.Property<string>("GCMRegistrationId")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<DateTime>("LatestActivityUpdate");
|
||||
b.Property<DateTime?>("LatestActivityUpdate");
|
||||
|
||||
b.Property<string>("Model");
|
||||
|
||||
@ -1103,8 +1104,14 @@ namespace Yavsc.Migrations
|
||||
|
||||
b.Property<string>("UserId");
|
||||
|
||||
b.Property<long>("AddressId");
|
||||
|
||||
b.Property<string>("ApplicationUserId");
|
||||
|
||||
b.Property<string>("EMail");
|
||||
|
||||
b.Property<string>("Name");
|
||||
|
||||
b.HasKey("OwnerId", "UserId");
|
||||
});
|
||||
|
||||
@ -1141,6 +1148,28 @@ namespace Yavsc.Migrations
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Relationship.PostalAddress", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<string>("City");
|
||||
|
||||
b.Property<string>("Country");
|
||||
|
||||
b.Property<string>("PostalCode");
|
||||
|
||||
b.Property<string>("Province");
|
||||
|
||||
b.Property<string>("State");
|
||||
|
||||
b.Property<string>("Street1");
|
||||
|
||||
b.Property<string>("Street2");
|
||||
|
||||
b.HasKey("Id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Relationship.Tag", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
@ -1376,10 +1405,14 @@ namespace Yavsc.Migrations
|
||||
|
||||
b.Property<DateTime>("DateModified");
|
||||
|
||||
b.Property<string>("ManagerId");
|
||||
b.Property<string>("ManagerId")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<string>("ReplyToAddress");
|
||||
|
||||
b.Property<string>("SuccessorId")
|
||||
.IsRequired();
|
||||
|
||||
b.Property<int>("ToSend");
|
||||
|
||||
b.Property<string>("Topic")
|
||||
@ -1645,18 +1678,18 @@ namespace Yavsc.Migrations
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("ApplicationUserId");
|
||||
.HasForeignKey("OwnerId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Chat.ChatRoomPresence", b =>
|
||||
modelBuilder.Entity("Yavsc.Models.Chat.ChatRoomAccess", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Chat.ChatRoom")
|
||||
.WithMany()
|
||||
.HasForeignKey("ChannelName");
|
||||
|
||||
b.HasOne("Yavsc.Models.Chat.ChatConnection")
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("ChatUserConnectionId");
|
||||
.HasForeignKey("UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Haircut.BrusherProfile", b =>
|
||||
@ -1753,7 +1786,7 @@ namespace Yavsc.Migrations
|
||||
.HasForeignKey("TaintId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Identity.GoogleCloudMobileDeclaration", b =>
|
||||
modelBuilder.Entity("Yavsc.Models.Identity.DeviceDeclaration", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
@ -1841,6 +1874,10 @@ namespace Yavsc.Migrations
|
||||
|
||||
modelBuilder.Entity("Yavsc.Models.Relationship.Contact", b =>
|
||||
{
|
||||
b.HasOne("Yavsc.Models.Relationship.PostalAddress")
|
||||
.WithMany()
|
||||
.HasForeignKey("AddressId");
|
||||
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("ApplicationUserId");
|
||||
@ -1950,6 +1987,10 @@ namespace Yavsc.Migrations
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("ManagerId");
|
||||
|
||||
b.HasOne("Yavsc.Models.ApplicationUser")
|
||||
.WithMany()
|
||||
.HasForeignKey("SuccessorId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Yavsc.Server.Models.IT.Project", b =>
|
||||
|
@ -47,7 +47,7 @@ namespace Yavsc.Models
|
||||
// For example, you can rename the ASP.NET Identity table names and more.
|
||||
// Add your customizations after calling base.OnModelCreating(builder);
|
||||
builder.Entity<Contact>().HasKey(x => new { x.OwnerId, x.UserId });
|
||||
builder.Entity<GoogleCloudMobileDeclaration>().Property(x => x.DeclarationDate).HasDefaultValueSql("LOCALTIMESTAMP");
|
||||
builder.Entity<DeviceDeclaration>().Property(x => x.DeclarationDate).HasDefaultValueSql("LOCALTIMESTAMP");
|
||||
builder.Entity<BlogTag>().HasKey(x => new { x.PostId, x.TagId });
|
||||
builder.Entity<ApplicationUser>().HasMany<ChatConnection>(c => c.Connections);
|
||||
builder.Entity<ApplicationUser>().Property(u => u.Avatar).HasDefaultValue(Constants.DefaultAvatar);
|
||||
@ -62,7 +62,7 @@ namespace Yavsc.Models
|
||||
builder.Entity<Period>().HasKey(l => new { l.Start, l.End });
|
||||
builder.Entity<Models.Cratie.Option>().HasKey(o => new { o.Code, o.CodeScrutin });
|
||||
builder.Entity<Notification>().Property(n => n.icon).HasDefaultValue("exclam");
|
||||
builder.Entity<ChatRoomPresence>().HasKey(p => new { room = p.ChannelName, user = p.ChatUserConnectionId });
|
||||
builder.Entity<ChatRoomAccess>().HasKey(p => new { room = p.ChannelName, user = p.UserId });
|
||||
|
||||
foreach (var et in builder.Model.GetEntityTypes())
|
||||
{
|
||||
@ -133,10 +133,10 @@ namespace Yavsc.Models
|
||||
public DbSet<OAuth2Tokens> Tokens { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// References all declared external GCM devices
|
||||
/// References all declared external NativeConfidential devices
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public DbSet<GoogleCloudMobileDeclaration> GCMDevices { get; set; }
|
||||
public DbSet<DeviceDeclaration> DeviceDeclaration { get; set; }
|
||||
|
||||
public DbSet<Service> Services { get; set; }
|
||||
public DbSet<Product> Products { get; set; }
|
||||
@ -157,7 +157,7 @@ namespace Yavsc.Models
|
||||
|
||||
public DbSet<EstimateTemplate> EstimateTemplates { get; set; }
|
||||
|
||||
public DbSet<Contact> Contacts { get; set; }
|
||||
public DbSet<Contact> Contact { get; set; }
|
||||
|
||||
public DbSet<ClientProviderInfo> ClientProviderInfo { get; set; }
|
||||
|
||||
|
@ -13,7 +13,7 @@ using Yavsc.Server.Helpers;
|
||||
|
||||
namespace Yavsc.Services
|
||||
{
|
||||
public class GCMSender : IGoogleCloudMessageSender
|
||||
public class GCMSender : IYavscMessageSender
|
||||
{
|
||||
private ILogger _logger;
|
||||
SiteSettings siteSettings;
|
||||
|
@ -274,7 +274,7 @@ namespace Yavsc
|
||||
|
||||
// Add application services.
|
||||
services.AddTransient<IEmailSender, MailSender>();
|
||||
services.AddTransient<IGoogleCloudMessageSender, GCMSender>();
|
||||
services.AddTransient<IYavscMessageSender, GCMSender>();
|
||||
services.AddTransient<IBillingService, BillingService>();
|
||||
services.AddTransient<IDataStore, FileDataStore>( (sp) => new FileDataStore("googledatastore",false) );
|
||||
services.AddTransient<ICalendarManager, CalendarManager>();
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"version": "1.0.5-*",
|
||||
"version": "1.0.6-*",
|
||||
"description": "encore une très petite entreprise",
|
||||
"authors": [
|
||||
"Paul Schneider <paul@pschneider.fr>"
|
||||
|
@ -42,7 +42,7 @@ namespace test
|
||||
[Fact]
|
||||
public void GitClone()
|
||||
{
|
||||
var firstProject = _dbContext.Projects.Include(p=>p.Repository).FirstOrDefault();
|
||||
var firstProject = _dbContext.Project.Include(p=>p.Repository).FirstOrDefault();
|
||||
Assert.NotNull (firstProject);
|
||||
var di = new DirectoryInfo(_serverFixture.SiteSetup.GitRepository);
|
||||
if (!di.Exists) di.Create();
|
||||
|
Reference in New Issue
Block a user