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: true),
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: "ApiResources",
columns: table => new
{
Id = table.Column(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityAlwaysColumn),
Enabled = table.Column(type: "boolean", nullable: false),
Name = table.Column(type: "text", nullable: true),
DisplayName = table.Column(type: "text", nullable: true),
Description = table.Column(type: "text", nullable: true),
AllowedAccessTokenSigningAlgorithms = table.Column(type: "text", nullable: true),
ShowInDiscoveryDocument = table.Column(type: "boolean", nullable: false),
Created = table.Column(type: "timestamp with time zone", nullable: false),
Updated = table.Column(type: "timestamp with time zone", nullable: true),
LastAccessed = table.Column(type: "timestamp with time zone", nullable: true),
NonEditable = table.Column(type: "boolean", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ApiResources", x => x.Id);
});
migrationBuilder.CreateTable(
name: "ApiScopes",
columns: table => new
{
Id = table.Column(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityAlwaysColumn),
Enabled = table.Column(type: "boolean", nullable: false),
Name = table.Column(type: "text", nullable: true),
DisplayName = table.Column(type: "text", nullable: true),
Description = table.Column(type: "text", nullable: true),
Required = table.Column(type: "boolean", nullable: false),
Emphasize = table.Column(type: "boolean", nullable: false),
ShowInDiscoveryDocument = table.Column(type: "boolean", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ApiScopes", x => x.Id);
});
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: "ClientProviderInfo",
columns: table => new
{
UserId = table.Column(type: "text", nullable: false),
UserName = table.Column(type: "text", nullable: true),
Avatar = table.Column(type: "text", nullable: true),
EMail = table.Column(type: "text", nullable: true),
Phone = table.Column(type: "text", nullable: true),
BillingAddressId = table.Column(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ClientProviderInfo", x => x.UserId);
});
migrationBuilder.CreateTable(
name: "Clients",
columns: table => new
{
Id = table.Column(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityAlwaysColumn),
Enabled = table.Column(type: "boolean", nullable: false),
ClientId = table.Column(type: "text", nullable: true),
ProtocolType = table.Column(type: "text", nullable: true),
RequireClientSecret = table.Column(type: "boolean", nullable: false),
ClientName = table.Column(type: "text", nullable: true),
Description = table.Column(type: "text", nullable: true),
ClientUri = table.Column(type: "text", nullable: true),
LogoUri = table.Column(type: "text", nullable: true),
RequireConsent = table.Column(type: "boolean", nullable: false),
AllowRememberConsent = table.Column(type: "boolean", nullable: false),
AlwaysIncludeUserClaimsInIdToken = table.Column(type: "boolean", nullable: false),
RequirePkce = table.Column(type: "boolean", nullable: false),
AllowPlainTextPkce = table.Column(type: "boolean", nullable: false),
RequireRequestObject = table.Column(type: "boolean", nullable: false),
AllowAccessTokensViaBrowser = table.Column(type: "boolean", nullable: false),
FrontChannelLogoutUri = table.Column(type: "text", nullable: true),
FrontChannelLogoutSessionRequired = table.Column(type: "boolean", nullable: false),
BackChannelLogoutUri = table.Column(type: "text", nullable: true),
BackChannelLogoutSessionRequired = table.Column(type: "boolean", nullable: false),
AllowOfflineAccess = table.Column(type: "boolean", nullable: false),
IdentityTokenLifetime = table.Column(type: "integer", nullable: false),
AllowedIdentityTokenSigningAlgorithms = table.Column(type: "text", nullable: true),
AccessTokenLifetime = table.Column(type: "integer", nullable: false),
AuthorizationCodeLifetime = table.Column(type: "integer", nullable: false),
ConsentLifetime = table.Column(type: "integer", nullable: true),
AbsoluteRefreshTokenLifetime = table.Column(type: "integer", nullable: false),
SlidingRefreshTokenLifetime = table.Column(type: "integer", nullable: false),
RefreshTokenUsage = table.Column(type: "integer", nullable: false),
UpdateAccessTokenClaimsOnRefresh = table.Column(type: "boolean", nullable: false),
RefreshTokenExpiration = table.Column(type: "integer", nullable: false),
AccessTokenType = table.Column(type: "integer", nullable: false),
EnableLocalLogin = table.Column(type: "boolean", nullable: false),
IncludeJwtId = table.Column(type: "boolean", nullable: false),
AlwaysSendClientClaims = table.Column(type: "boolean", nullable: false),
ClientClaimsPrefix = table.Column(type: "text", nullable: true),
PairWiseSubjectSalt = table.Column(type: "text", nullable: true),
Created = table.Column(type: "timestamp with time zone", nullable: false),
Updated = table.Column(type: "timestamp with time zone", nullable: true),
LastAccessed = table.Column(type: "timestamp with time zone", nullable: true),
UserSsoLifetime = table.Column(type: "integer", nullable: true),
UserCodeType = table.Column(type: "text", nullable: true),
DeviceCodeLifetime = table.Column(type: "integer", nullable: false),
NonEditable = table.Column(type: "boolean", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Clients", x => x.Id);
});
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: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Color", x => x.Id);
});
migrationBuilder.CreateTable(
name: "DeviceFlowCodes",
columns: table => new
{
DeviceCode = table.Column(type: "text", nullable: false),
UserCode = table.Column(type: "text", nullable: false),
SubjectId = table.Column(type: "text", nullable: true),
SessionId = table.Column(type: "text", nullable: true),
ClientId = table.Column(type: "text", nullable: true),
Description = table.Column(type: "text", nullable: true),
CreationTime = table.Column(type: "timestamp with time zone", nullable: false),
Expiration = table.Column(type: "timestamp with time zone", nullable: true),
Data = table.Column(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_DeviceFlowCodes", x => new { x.UserCode, x.DeviceCode });
});
migrationBuilder.CreateTable(
name: "DjSettings",
columns: table => new
{
UserId = table.Column(type: "text", nullable: false),
SoundCloudId = table.Column(type: "text", nullable: true)
},
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: true),
Title = table.Column(type: "text", nullable: true),
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: true),
Description = table.Column(type: "text", nullable: true),
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: true)
},
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: true)
},
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: "IdentityResources",
columns: table => new
{
Id = table.Column(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Enabled = table.Column(type: "boolean", nullable: false),
Name = table.Column(type: "text", nullable: true),
DisplayName = table.Column(type: "text", nullable: true),
Description = table.Column(type: "text", nullable: true),
Required = table.Column(type: "boolean", nullable: false),
Emphasize = table.Column(type: "boolean", nullable: false),
ShowInDiscoveryDocument = table.Column(type: "boolean", nullable: false),
Created = table.Column(type: "timestamp with time zone", nullable: false),
Updated = table.Column(type: "timestamp with time zone", nullable: true),
NonEditable = table.Column(type: "boolean", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_IdentityResources", 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: true),
Body = table.Column(type: "character varying(65536)", maxLength: 65536, nullable: true),
ReplyToAddress = table.Column(type: "text", nullable: true),
ToSend = table.Column(type: "integer", nullable: false),
UserCreated = table.Column(type: "text", nullable: true),
UserModified = table.Column(type: "text", nullable: true)
},
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: 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)
},
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: "PersistedGrants",
columns: table => new
{
Key = table.Column(type: "text", nullable: false),
Type = table.Column(type: "text", nullable: true),
SubjectId = table.Column(type: "text", nullable: true),
SessionId = table.Column(type: "text", nullable: true),
ClientId = table.Column(type: "text", nullable: true),
Description = table.Column(type: "text", nullable: true),
CreationTime = table.Column(type: "timestamp with time zone", nullable: false),
Expiration = table.Column(type: "timestamp with time zone", nullable: true),
ConsumedTime = table.Column(type: "timestamp with time zone", nullable: true),
Data = table.Column(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_PersistedGrants", x => x.Key);
});
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: true),
Street2 = table.Column(type: "text", nullable: true),
PostalCode = table.Column(type: "text", nullable: true),
City = table.Column(type: "text", nullable: true),
State = table.Column(type: "text", nullable: true),
Province = table.Column(type: "text", nullable: true),
Country = table.Column(type: "text", nullable: true)
},
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: true),
Description = table.Column(type: "text", nullable: true),
Public = table.Column(type: "boolean", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Products", 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: true),
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: true),
Title = table.Column(type: "text", nullable: true),
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: true),
Name = table.Column(type: "text", nullable: true),
Description = table.Column(type: "text", nullable: true),
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");
});
migrationBuilder.CreateTable(
name: "ApiResourceClaims",
columns: table => new
{
Id = table.Column(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
ApiResourceId = table.Column(type: "integer", nullable: false),
ApiResourceId1 = table.Column(type: "integer", nullable: true),
Type = table.Column(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_ApiResourceClaims", x => x.Id);
table.ForeignKey(
name: "FK_ApiResourceClaims_ApiResources_ApiResourceId",
column: x => x.ApiResourceId,
principalTable: "ApiResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ApiResourceClaims_ApiResources_ApiResourceId1",
column: x => x.ApiResourceId1,
principalTable: "ApiResources",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "ApiResourceProperties",
columns: table => new
{
Id = table.Column(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
ApiResourceId = table.Column(type: "integer", nullable: false),
ApiResourceId1 = table.Column(type: "integer", nullable: true),
Key = table.Column(type: "text", nullable: true),
Value = table.Column(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_ApiResourceProperties", x => x.Id);
table.ForeignKey(
name: "FK_ApiResourceProperties_ApiResources_ApiResourceId",
column: x => x.ApiResourceId,
principalTable: "ApiResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ApiResourceProperties_ApiResources_ApiResourceId1",
column: x => x.ApiResourceId1,
principalTable: "ApiResources",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "ApiResourceScopes",
columns: table => new
{
Id = table.Column(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Scope = table.Column(type: "text", nullable: true),
ApiResourceId = table.Column(type: "integer", nullable: false),
ApiResourceId1 = table.Column(type: "integer", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_ApiResourceScopes", x => x.Id);
table.ForeignKey(
name: "FK_ApiResourceScopes_ApiResources_ApiResourceId",
column: x => x.ApiResourceId,
principalTable: "ApiResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ApiResourceScopes_ApiResources_ApiResourceId1",
column: x => x.ApiResourceId1,
principalTable: "ApiResources",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "ApiResourceSecrets",
columns: table => new
{
Id = table.Column(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
ApiResourceId = table.Column(type: "integer", nullable: false),
ApiResourceId1 = table.Column(type: "integer", nullable: true),
Description = table.Column(type: "text", nullable: true),
Value = table.Column(type: "text", nullable: true),
Expiration = table.Column(type: "timestamp with time zone", nullable: true),
Type = table.Column(type: "text", nullable: true),
Created = table.Column(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ApiResourceSecrets", x => x.Id);
table.ForeignKey(
name: "FK_ApiResourceSecrets_ApiResources_ApiResourceId",
column: x => x.ApiResourceId,
principalTable: "ApiResources",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ApiResourceSecrets_ApiResources_ApiResourceId1",
column: x => x.ApiResourceId1,
principalTable: "ApiResources",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "ApiScopeClaims",
columns: table => new
{
Id = table.Column(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
ScopeId = table.Column(type: "integer", nullable: false),
ScopeId1 = table.Column(type: "integer", nullable: true),
Type = table.Column(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_ApiScopeClaims", x => x.Id);
table.ForeignKey(
name: "FK_ApiScopeClaims_ApiScopes_ScopeId",
column: x => x.ScopeId,
principalTable: "ApiScopes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ApiScopeClaims_ApiScopes_ScopeId1",
column: x => x.ScopeId1,
principalTable: "ApiScopes",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "ApiScopeProperties",
columns: table => new
{
Id = table.Column(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
ScopeId = table.Column(type: "integer", nullable: false),
ScopeId1 = table.Column(type: "integer", nullable: true),
Key = table.Column(type: "text", nullable: true),
Value = table.Column(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_ApiScopeProperties", x => x.Id);
table.ForeignKey(
name: "FK_ApiScopeProperties_ApiScopes_ScopeId",
column: x => x.ScopeId,
principalTable: "ApiScopes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ApiScopeProperties_ApiScopes_ScopeId1",
column: x => x.ScopeId1,
principalTable: "ApiScopes",
principalColumn: "Id");
});
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: "ClientClaims",
columns: table => new
{
Id = table.Column(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityAlwaysColumn),
Type = table.Column(type: "text", nullable: true),
Value = table.Column(type: "text", nullable: true),
ClientId = table.Column(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ClientClaims", x => x.Id);
table.ForeignKey(
name: "FK_ClientClaims_Clients_ClientId",
column: x => x.ClientId,
principalTable: "Clients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "ClientCorsOrigins",
columns: table => new
{
Id = table.Column(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityAlwaysColumn),
Origin = table.Column(type: "text", nullable: true),
ClientId = table.Column(type: "integer", nullable: false),
ClientId1 = table.Column(type: "integer", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_ClientCorsOrigins", x => x.Id);
table.ForeignKey(
name: "FK_ClientCorsOrigins_Clients_ClientId",
column: x => x.ClientId,
principalTable: "Clients",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_ClientCorsOrigins_Clients_ClientId1",
column: x => x.ClientId1,
principalTable: "Clients",
principalColumn: "Id");
});
migrationBuilder.CreateTable(
name: "ClientGrantTypes",
columns: table => new
{
Id = table.Column(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityAlwaysColumn),
GrantType = table.Column