using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Yavsc.Migrations
{
///
public partial class init : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Activities",
columns: table => new
{
Code = table.Column(type: "text", nullable: false),
Name = table.Column(type: "text", nullable: false),
ParentCode = table.Column(type: "text", nullable: true),
Description = table.Column(type: "text", nullable: false),
Photo = table.Column(type: "text", nullable: true),
ModeratorGroupName = table.Column(type: "text", nullable: true),
Rate = table.Column(type: "integer", nullable: false),
SettingsClassName = table.Column(type: "text", nullable: true),
DateCreated = table.Column(type: "timestamp with time zone", nullable: false),
UserCreated = table.Column(type: "text", nullable: true),
DateModified = table.Column(type: "timestamp with time zone", nullable: false),
UserModified = table.Column(type: "text", nullable: true),
Hidden = table.Column(type: "boolean", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Activities", x => x.Code);
table.ForeignKey(
name: "FK_Activities_Activities_ParentCode",
column: x => x.ParentCode,
principalTable: "Activities",
principalColumn: "Code");
});
migrationBuilder.CreateTable(
name: "AspNetRoles",
columns: table => new
{
Id = table.Column(type: "text", nullable: false),
Name = table.Column(type: "character varying(256)", maxLength: 256, nullable: true),
NormalizedName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true),
ConcurrencyStamp = table.Column(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetRoles", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Client",
columns: table => new
{
Id = table.Column(type: "text", nullable: false),
DisplayName = table.Column(type: "character varying(128)", maxLength: 128, nullable: false),
RedirectUri = table.Column(type: "character varying(512)", maxLength: 512, nullable: true),
LogoutRedirectUri = table.Column(type: "character varying(512)", maxLength: 512, nullable: true),
Secret = table.Column(type: "character varying(512)", maxLength: 512, nullable: false),
Type = table.Column(type: "integer", nullable: false),
Active = table.Column(type: "boolean", nullable: false),
RefreshTokenLifeTime = table.Column(type: "integer", nullable: false),
AccessTokenLifetime = table.Column(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Client", x => x.Id);
});
migrationBuilder.CreateTable(
name: "ClientProviderInfo",
columns: table => new
{
UserId = table.Column(type: "text", nullable: false),
UserName = table.Column(type: "text", nullable: false),
Avatar = table.Column(type: "text", nullable: false),
EMail = table.Column(type: "text", nullable: false),
Phone = table.Column(type: "text", nullable: false),
BillingAddressId = table.Column(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ClientProviderInfo", x => x.UserId);
});
migrationBuilder.CreateTable(
name: "Color",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Red = table.Column(type: "smallint", nullable: false),
Green = table.Column(type: "smallint", nullable: false),
Blue = table.Column(type: "smallint", nullable: false),
Name = table.Column(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Color", x => x.Id);
});
migrationBuilder.CreateTable(
name: "DjSettings",
columns: table => new
{
UserId = table.Column(type: "text", nullable: false),
SoundCloudId = table.Column(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_DjSettings", x => x.UserId);
});
migrationBuilder.CreateTable(
name: "EstimateTemplates",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Description = table.Column(type: "text", nullable: false),
Title = table.Column(type: "text", nullable: false),
OwnerId = table.Column(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_EstimateTemplates", x => x.Id);
});
migrationBuilder.CreateTable(
name: "ExceptionsSIREN",
columns: table => new
{
SIREN = table.Column(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ExceptionsSIREN", x => x.SIREN);
});
migrationBuilder.CreateTable(
name: "Feature",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
ShortName = table.Column(type: "text", nullable: false),
Description = table.Column(type: "text", nullable: false),
Status = table.Column(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Feature", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Form",
columns: table => new
{
Id = table.Column(type: "text", nullable: false),
Summary = table.Column(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Form", x => x.Id);
});
migrationBuilder.CreateTable(
name: "FormationSettings",
columns: table => new
{
UserId = table.Column(type: "text", nullable: false),
DisplayName = table.Column(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_FormationSettings", x => x.UserId);
});
migrationBuilder.CreateTable(
name: "GeneralSettings",
columns: table => new
{
UserId = table.Column(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_GeneralSettings", x => x.UserId);
});
migrationBuilder.CreateTable(
name: "HairPrestation",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Length = table.Column(type: "integer", nullable: false),
Gender = table.Column(type: "integer", nullable: false),
Cut = table.Column(type: "boolean", nullable: false),
Dressing = table.Column(type: "integer", nullable: false),
Tech = table.Column(type: "integer", nullable: false),
Shampoo = table.Column(type: "boolean", nullable: false),
Cares = table.Column(type: "boolean", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_HairPrestation", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Instrument",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Name = table.Column(type: "character varying(255)", maxLength: 255, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Instrument", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Locations",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Address = table.Column(type: "character varying(512)", maxLength: 512, nullable: false),
Longitude = table.Column(type: "double precision", nullable: false),
Latitude = table.Column(type: "double precision", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Locations", x => x.Id);
});
migrationBuilder.CreateTable(
name: "MailingTemplate",
columns: table => new
{
Id = table.Column(type: "text", nullable: false),
DateCreated = table.Column(type: "timestamp with time zone", nullable: false),
DateModified = table.Column(type: "timestamp with time zone", nullable: false),
Topic = table.Column(type: "text", nullable: false),
Body = table.Column(type: "character varying(65536)", maxLength: 65536, nullable: false),
ReplyToAddress = table.Column(type: "text", nullable: false),
ToSend = table.Column(type: "integer", nullable: false),
UserCreated = table.Column(type: "text", nullable: false),
UserModified = table.Column(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_MailingTemplate", x => x.Id);
});
migrationBuilder.CreateTable(
name: "MusicalTendency",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Name = table.Column(type: "character varying(255)", maxLength: 255, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_MusicalTendency", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Notification",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
title = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: false),
body = table.Column(type: "character varying(512)", maxLength: 512, nullable: false),
icon = table.Column(type: "character varying(512)", maxLength: 512, nullable: true, defaultValue: "exclam"),
sound = table.Column(type: "character varying(512)", maxLength: 512, nullable: true),
tag = table.Column(type: "character varying(512)", maxLength: 512, nullable: true),
color = table.Column(type: "character varying(512)", maxLength: 512, nullable: true),
click_action = table.Column(type: "character varying(512)", maxLength: 512, nullable: false),
Target = table.Column(type: "character varying(512)", maxLength: 512, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Notification", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Option",
columns: table => new
{
CodeScrutin = table.Column(type: "text", nullable: false),
Code = table.Column(type: "text", nullable: false),
Description = table.Column(type: "text", nullable: false),
DateCreated = table.Column(type: "timestamp with time zone", nullable: false),
UserCreated = table.Column(type: "text", nullable: false),
DateModified = table.Column(type: "timestamp with time zone", nullable: false),
UserModified = table.Column(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Option", x => new { x.Code, x.CodeScrutin });
});
migrationBuilder.CreateTable(
name: "Period",
columns: table => new
{
Start = table.Column(type: "timestamp with time zone", nullable: false),
End = table.Column(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Period", x => new { x.Start, x.End });
});
migrationBuilder.CreateTable(
name: "PostalAddress",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Street1 = table.Column(type: "text", nullable: false),
Street2 = table.Column(type: "text", nullable: false),
PostalCode = table.Column(type: "text", nullable: false),
City = table.Column(type: "text", nullable: false),
State = table.Column(type: "text", nullable: false),
Province = table.Column(type: "text", nullable: false),
Country = table.Column(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_PostalAddress", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Products",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Weight = table.Column(type: "numeric", nullable: false),
Height = table.Column(type: "numeric", nullable: false),
Width = table.Column(type: "numeric", nullable: false),
Depth = table.Column(type: "numeric", nullable: false),
Price = table.Column(type: "numeric", nullable: true),
Name = table.Column(type: "text", nullable: false),
Description = table.Column(type: "text", nullable: false),
Public = table.Column(type: "boolean", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Products", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Scopes",
columns: table => new
{
Id = table.Column(type: "text", nullable: false),
Description = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Scopes", x => x.Id);
});
migrationBuilder.CreateTable(
name: "SiteSkills",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Name = table.Column(type: "text", nullable: false),
Rate = table.Column(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_SiteSkills", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Tags",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Name = table.Column(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Tags", x => x.Id);
});
migrationBuilder.CreateTable(
name: "CommandForm",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
ActionName = table.Column(type: "text", nullable: false),
Title = table.Column(type: "text", nullable: false),
ActivityCode = table.Column(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_CommandForm", x => x.Id);
table.ForeignKey(
name: "FK_CommandForm_Activities_ActivityCode",
column: x => x.ActivityCode,
principalTable: "Activities",
principalColumn: "Code",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Services",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
ContextId = table.Column(type: "text", nullable: false),
Name = table.Column(type: "text", nullable: false),
Description = table.Column(type: "text", nullable: false),
Public = table.Column(type: "boolean", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Services", x => x.Id);
table.ForeignKey(
name: "FK_Services_Activities_ContextId",
column: x => x.ContextId,
principalTable: "Activities",
principalColumn: "Code",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetRoleClaims",
columns: table => new
{
Id = table.Column(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
RoleId = table.Column(type: "text", nullable: false),
ClaimType = table.Column(type: "text", nullable: true),
ClaimValue = table.Column(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetRoleClaims", x => x.Id);
table.ForeignKey(
name: "FK_AspNetRoleClaims_AspNetRoles_RoleId",
column: x => x.RoleId,
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "HairTaint",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Brand = table.Column(type: "text", nullable: false),
ColorId = table.Column(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_HairTaint", x => x.Id);
table.ForeignKey(
name: "FK_HairTaint_Color_ColorId",
column: x => x.ColorId,
principalTable: "Color",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Bug",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
FeatureId = table.Column(type: "bigint", nullable: true),
Title = table.Column(type: "text", nullable: false),
Description = table.Column(type: "text", nullable: false),
Status = table.Column(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Bug", x => x.Id);
table.ForeignKey(
name: "FK_Bug_Feature_FeatureId",
column: x => x.FeatureId,
principalTable: "Feature",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "MusicalPreference",
columns: table => new
{
OwnerProfileId = table.Column(type: "text", nullable: false),
Rate = table.Column(type: "integer", nullable: false),
TendencyId = table.Column(type: "bigint", nullable: false),
DjSettingsUserId = table.Column(type: "text", nullable: true),
GeneralSettingsUserId = table.Column(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_MusicalPreference", x => x.OwnerProfileId);
table.ForeignKey(
name: "FK_MusicalPreference_DjSettings_DjSettingsUserId",
column: x => x.DjSettingsUserId,
principalTable: "DjSettings",
principalColumn: "UserId");
table.ForeignKey(
name: "FK_MusicalPreference_GeneralSettings_GeneralSettingsUserId",
column: x => x.GeneralSettingsUserId,
principalTable: "GeneralSettings",
principalColumn: "UserId");
});
migrationBuilder.CreateTable(
name: "AspNetUsers",
columns: table => new
{
Id = table.Column(type: "text", nullable: false),
Avatar = table.Column(type: "character varying(512)", maxLength: 512, nullable: true, defaultValue: "/images/Users/icon_user.png"),
FullName = table.Column(type: "character varying(512)", maxLength: 512, nullable: true),
PostalAddressId = table.Column(type: "bigint", nullable: true),
DedicatedGoogleCalendar = table.Column(type: "character varying(512)", maxLength: 512, nullable: true),
DiskQuota = table.Column(type: "bigint", nullable: false, defaultValue: 524288000L),
DiskUsage = table.Column(type: "bigint", nullable: false),
MaxFileSize = table.Column(type: "bigint", nullable: false),
AllowMonthlyEmail = table.Column(type: "boolean", nullable: false),
UserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true),
NormalizedUserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true),
Email = table.Column(type: "character varying(256)", maxLength: 256, nullable: false),
NormalizedEmail = table.Column(type: "character varying(256)", maxLength: 256, nullable: true),
EmailConfirmed = table.Column(type: "boolean", nullable: false),
PasswordHash = table.Column(type: "text", nullable: true),
SecurityStamp = table.Column(type: "text", nullable: true),
ConcurrencyStamp = table.Column(type: "text", nullable: true),
PhoneNumber = table.Column(type: "text", nullable: true),
PhoneNumberConfirmed = table.Column(type: "boolean", nullable: false),
TwoFactorEnabled = table.Column(type: "boolean", nullable: false),
LockoutEnd = table.Column(type: "timestamp with time zone", nullable: true),
LockoutEnabled = table.Column(type: "boolean", nullable: false),
AccessFailedCount = table.Column(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUsers", x => x.Id);
table.UniqueConstraint("AK_AspNetUsers_Email", x => x.Email);
table.ForeignKey(
name: "FK_AspNetUsers_Locations_PostalAddressId",
column: x => x.PostalAddressId,
principalTable: "Locations",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "HairTaintInstance",
columns: table => new
{
TaintId = table.Column(type: "bigint", nullable: false),
PrestationId = table.Column(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_HairTaintInstance", x => new { x.TaintId, x.PrestationId });
table.ForeignKey(
name: "FK_HairTaintInstance_HairPrestation_PrestationId",
column: x => x.PrestationId,
principalTable: "HairPrestation",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_HairTaintInstance_HairTaint_TaintId",
column: x => x.TaintId,
principalTable: "HairTaint",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Announce",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
For = table.Column(type: "smallint", nullable: false),
OwnerId = table.Column(type: "text", nullable: false),
Message = table.Column(type: "text", nullable: false),
Topic = table.Column(type: "text", nullable: false),
Sender = table.Column(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Announce", x => x.Id);
table.ForeignKey(
name: "FK_Announce_AspNetUsers_OwnerId",
column: x => x.OwnerId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserClaims",
columns: table => new
{
Id = table.Column(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
UserId = table.Column(type: "text", nullable: false),
ClaimType = table.Column(type: "text", nullable: true),
ClaimValue = table.Column(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserClaims", x => x.Id);
table.ForeignKey(
name: "FK_AspNetUserClaims_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserLogins",
columns: table => new
{
LoginProvider = table.Column(type: "text", nullable: false),
ProviderKey = table.Column(type: "text", nullable: false),
ProviderDisplayName = table.Column(type: "text", nullable: true),
UserId = table.Column(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserLogins", x => new { x.LoginProvider, x.ProviderKey });
table.ForeignKey(
name: "FK_AspNetUserLogins_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserRoles",
columns: table => new
{
UserId = table.Column(type: "text", nullable: false),
RoleId = table.Column(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserRoles", x => new { x.UserId, x.RoleId });
table.ForeignKey(
name: "FK_AspNetUserRoles_AspNetRoles_RoleId",
column: x => x.RoleId,
principalTable: "AspNetRoles",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_AspNetUserRoles_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "AspNetUserTokens",
columns: table => new
{
UserId = table.Column(type: "text", nullable: false),
LoginProvider = table.Column(type: "text", nullable: false),
Name = table.Column(type: "text", nullable: false),
Value = table.Column(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AspNetUserTokens", x => new { x.UserId, x.LoginProvider, x.Name });
table.ForeignKey(
name: "FK_AspNetUserTokens_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Ban",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
DateCreated = table.Column(type: "timestamp with time zone", nullable: false),
DateModified = table.Column(type: "timestamp with time zone", nullable: false),
UserCreated = table.Column(type: "text", nullable: false),
UserModified = table.Column(type: "text", nullable: false),
TargetId = table.Column(type: "text", nullable: false),
Reason = table.Column(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Ban", x => x.Id);
table.ForeignKey(
name: "FK_Ban_AspNetUsers_TargetId",
column: x => x.TargetId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "BankIdentity",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
BIC = table.Column(type: "text", nullable: false),
IBAN = table.Column(type: "text", nullable: false),
BankCode = table.Column(type: "text", nullable: false),
WicketCode = table.Column(type: "text", nullable: false),
AccountNumber = table.Column(type: "text", nullable: false),
BankedKey = table.Column(type: "integer", nullable: false),
UserId = table.Column(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_BankIdentity", x => x.Id);
table.ForeignKey(
name: "FK_BankIdentity_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "BankStatus",
columns: table => new
{
UserId = table.Column(type: "text", nullable: false),
Credits = table.Column(type: "numeric", nullable: false),
ContactCredits = table.Column(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_BankStatus", x => x.UserId);
table.ForeignKey(
name: "FK_BankStatus_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "BlackListed",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
UserId = table.Column(type: "text", nullable: false),
OwnerId = table.Column(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_BlackListed", x => x.Id);
table.ForeignKey(
name: "FK_BlackListed_AspNetUsers_OwnerId",
column: x => x.OwnerId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_BlackListed_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "BlogSpot",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
AuthorId = table.Column(type: "text", nullable: true),
DateCreated = table.Column(type: "timestamp with time zone", nullable: false),
UserCreated = table.Column(type: "text", nullable: true),
DateModified = table.Column(type: "timestamp with time zone", nullable: false),
UserModified = table.Column(type: "text", nullable: true),
Photo = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: true),
Title = table.Column(type: "character varying(1024)", maxLength: 1024, nullable: false),
Content = table.Column(type: "character varying(56224)", maxLength: 56224, nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_BlogSpot", x => x.Id);
table.ForeignKey(
name: "FK_BlogSpot_AspNetUsers_AuthorId",
column: x => x.AuthorId,
principalTable: "AspNetUsers",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "ChatConnection",
columns: table => new
{
ConnectionId = table.Column(type: "text", nullable: false),
ApplicationUserId = table.Column(type: "text", nullable: false),
UserAgent = table.Column(type: "text", nullable: false),
Connected = table.Column(type: "boolean", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ChatConnection", x => x.ConnectionId);
table.ForeignKey(
name: "FK_ChatConnection_AspNetUsers_ApplicationUserId",
column: x => x.ApplicationUserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "ChatRoom",
columns: table => new
{
Name = table.Column(type: "text", nullable: false),
Topic = table.Column(type: "text", nullable: false),
OwnerId = table.Column(type: "text", nullable: false),
LatestJoinPart = table.Column(type: "timestamp with time zone", nullable: false),
DateCreated = table.Column(type: "timestamp with time zone", nullable: false),
UserCreated = table.Column(type: "text", nullable: false),
DateModified = table.Column(type: "timestamp with time zone", nullable: false),
UserModified = table.Column(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ChatRoom", x => x.Name);
table.ForeignKey(
name: "FK_ChatRoom_AspNetUsers_OwnerId",
column: x => x.OwnerId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Circle",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Public = table.Column(type: "boolean", nullable: false),
Name = table.Column(type: "text", nullable: false),
OwnerId = table.Column(type: "text", nullable: false),
ApplicationUserId = table.Column(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Circle", x => x.Id);
table.ForeignKey(
name: "FK_Circle_AspNetUsers_ApplicationUserId",
column: x => x.ApplicationUserId,
principalTable: "AspNetUsers",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "Contact",
columns: table => new
{
UserId = table.Column(type: "text", nullable: false),
OwnerId = table.Column(type: "text", nullable: false),
Name = table.Column(type: "text", nullable: false),
EMail = table.Column(type: "text", nullable: false),
AddressId = table.Column(type: "bigint", nullable: false),
ApplicationUserId = table.Column(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Contact", x => new { x.OwnerId, x.UserId });
table.ForeignKey(
name: "FK_Contact_AspNetUsers_ApplicationUserId",
column: x => x.ApplicationUserId,
principalTable: "AspNetUsers",
principalColumn: "Id");
table.ForeignKey(
name: "FK_Contact_PostalAddress_AddressId",
column: x => x.AddressId,
principalTable: "PostalAddress",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "DeviceDeclaration",
columns: table => new
{
DeviceId = table.Column(type: "text", nullable: false),
Model = table.Column(type: "text", nullable: false),
Platform = table.Column(type: "text", nullable: false),
Version = table.Column(type: "text", nullable: false),
DeviceOwnerId = table.Column(type: "text", nullable: false),
DeclarationDate = table.Column(type: "timestamp with time zone", nullable: false, defaultValueSql: "LOCALTIMESTAMP"),
LatestActivityUpdate = table.Column(type: "timestamp with time zone", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_DeviceDeclaration", x => x.DeviceId);
table.ForeignKey(
name: "FK_DeviceDeclaration_AspNetUsers_DeviceOwnerId",
column: x => x.DeviceOwnerId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "DismissClicked",
columns: table => new
{
UserId = table.Column(type: "text", nullable: false),
NotificationId = table.Column(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_DismissClicked", x => new { x.UserId, x.NotificationId });
table.ForeignKey(
name: "FK_DismissClicked_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DismissClicked_Notification_NotificationId",
column: x => x.NotificationId,
principalTable: "Notification",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "GitRepositoryReference",
columns: table => new
{
Id = table.Column(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Path = table.Column