RobotApp/RobotApp/Data/Migrations/20250926020848_initDb.cs
2025-09-26 09:37:06 +07:00

722 lines
24 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace RobotApp.Data.Migrations
{
/// <inheritdoc />
public partial class initDb : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "UserNameIndex",
table: "AspNetUsers");
migrationBuilder.DropIndex(
name: "RoleNameIndex",
table: "AspNetRoles");
migrationBuilder.AlterColumn<string>(
name: "Value",
table: "AspNetUserTokens",
type: "TEXT",
nullable: true,
oldClrType: typeof(string),
oldType: "Text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "AspNetUserTokens",
type: "TEXT",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(450)");
migrationBuilder.AlterColumn<string>(
name: "LoginProvider",
table: "AspNetUserTokens",
type: "TEXT",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(450)");
migrationBuilder.AlterColumn<string>(
name: "UserId",
table: "AspNetUserTokens",
type: "TEXT",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(450)");
migrationBuilder.AlterColumn<string>(
name: "UserName",
table: "AspNetUsers",
type: "TEXT",
maxLength: 256,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(256)",
oldMaxLength: 256,
oldNullable: true);
migrationBuilder.AlterColumn<bool>(
name: "TwoFactorEnabled",
table: "AspNetUsers",
type: "INTEGER",
nullable: false,
oldClrType: typeof(bool),
oldType: "bit");
migrationBuilder.AlterColumn<string>(
name: "SecurityStamp",
table: "AspNetUsers",
type: "TEXT",
nullable: true,
oldClrType: typeof(string),
oldType: "Text",
oldNullable: true);
migrationBuilder.AlterColumn<bool>(
name: "PhoneNumberConfirmed",
table: "AspNetUsers",
type: "INTEGER",
nullable: false,
oldClrType: typeof(bool),
oldType: "bit");
migrationBuilder.AlterColumn<string>(
name: "PhoneNumber",
table: "AspNetUsers",
type: "TEXT",
nullable: true,
oldClrType: typeof(string),
oldType: "Text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "PasswordHash",
table: "AspNetUsers",
type: "TEXT",
nullable: true,
oldClrType: typeof(string),
oldType: "Text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "NormalizedUserName",
table: "AspNetUsers",
type: "TEXT",
maxLength: 256,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(256)",
oldMaxLength: 256,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "NormalizedEmail",
table: "AspNetUsers",
type: "TEXT",
maxLength: 256,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(256)",
oldMaxLength: 256,
oldNullable: true);
migrationBuilder.AlterColumn<DateTimeOffset>(
name: "LockoutEnd",
table: "AspNetUsers",
type: "TEXT",
nullable: true,
oldClrType: typeof(DateTimeOffset),
oldType: "datetimeoffset",
oldNullable: true);
migrationBuilder.AlterColumn<bool>(
name: "LockoutEnabled",
table: "AspNetUsers",
type: "INTEGER",
nullable: false,
oldClrType: typeof(bool),
oldType: "bit");
migrationBuilder.AlterColumn<bool>(
name: "EmailConfirmed",
table: "AspNetUsers",
type: "INTEGER",
nullable: false,
oldClrType: typeof(bool),
oldType: "bit");
migrationBuilder.AlterColumn<string>(
name: "Email",
table: "AspNetUsers",
type: "TEXT",
maxLength: 256,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(256)",
oldMaxLength: 256,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AspNetUsers",
type: "TEXT",
nullable: true,
oldClrType: typeof(string),
oldType: "Text",
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "AccessFailedCount",
table: "AspNetUsers",
type: "INTEGER",
nullable: false,
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AlterColumn<string>(
name: "Id",
table: "AspNetUsers",
type: "TEXT",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(450)");
migrationBuilder.AlterColumn<string>(
name: "RoleId",
table: "AspNetUserRoles",
type: "TEXT",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(450)");
migrationBuilder.AlterColumn<string>(
name: "UserId",
table: "AspNetUserRoles",
type: "TEXT",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(450)");
migrationBuilder.AlterColumn<string>(
name: "UserId",
table: "AspNetUserLogins",
type: "TEXT",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(450)");
migrationBuilder.AlterColumn<string>(
name: "ProviderDisplayName",
table: "AspNetUserLogins",
type: "TEXT",
nullable: true,
oldClrType: typeof(string),
oldType: "Text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ProviderKey",
table: "AspNetUserLogins",
type: "TEXT",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(450)");
migrationBuilder.AlterColumn<string>(
name: "LoginProvider",
table: "AspNetUserLogins",
type: "TEXT",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(450)");
migrationBuilder.AlterColumn<string>(
name: "UserId",
table: "AspNetUserClaims",
type: "TEXT",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(450)");
migrationBuilder.AlterColumn<string>(
name: "ClaimValue",
table: "AspNetUserClaims",
type: "TEXT",
nullable: true,
oldClrType: typeof(string),
oldType: "Text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ClaimType",
table: "AspNetUserClaims",
type: "TEXT",
nullable: true,
oldClrType: typeof(string),
oldType: "Text",
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "Id",
table: "AspNetUserClaims",
type: "INTEGER",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("Sqlite:Autoincrement", true)
.OldAnnotation("Sqlite:Autoincrement", true);
migrationBuilder.AlterColumn<string>(
name: "NormalizedName",
table: "AspNetRoles",
type: "TEXT",
maxLength: 256,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(256)",
oldMaxLength: 256,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "AspNetRoles",
type: "TEXT",
maxLength: 256,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(256)",
oldMaxLength: 256,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AspNetRoles",
type: "TEXT",
nullable: true,
oldClrType: typeof(string),
oldType: "Text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Id",
table: "AspNetRoles",
type: "TEXT",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(450)");
migrationBuilder.AlterColumn<string>(
name: "RoleId",
table: "AspNetRoleClaims",
type: "TEXT",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(450)");
migrationBuilder.AlterColumn<string>(
name: "ClaimValue",
table: "AspNetRoleClaims",
type: "TEXT",
nullable: true,
oldClrType: typeof(string),
oldType: "Text",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ClaimType",
table: "AspNetRoleClaims",
type: "TEXT",
nullable: true,
oldClrType: typeof(string),
oldType: "Text",
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "Id",
table: "AspNetRoleClaims",
type: "INTEGER",
nullable: false,
oldClrType: typeof(int),
oldType: "int")
.Annotation("Sqlite:Autoincrement", true)
.OldAnnotation("Sqlite:Autoincrement", true);
migrationBuilder.CreateIndex(
name: "UserNameIndex",
table: "AspNetUsers",
column: "NormalizedUserName",
unique: true);
migrationBuilder.CreateIndex(
name: "RoleNameIndex",
table: "AspNetRoles",
column: "NormalizedName",
unique: true);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropIndex(
name: "UserNameIndex",
table: "AspNetUsers");
migrationBuilder.DropIndex(
name: "RoleNameIndex",
table: "AspNetRoles");
migrationBuilder.AlterColumn<string>(
name: "Value",
table: "AspNetUserTokens",
type: "Text",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "AspNetUserTokens",
type: "nvarchar(450)",
nullable: false,
oldClrType: typeof(string),
oldType: "TEXT");
migrationBuilder.AlterColumn<string>(
name: "LoginProvider",
table: "AspNetUserTokens",
type: "nvarchar(450)",
nullable: false,
oldClrType: typeof(string),
oldType: "TEXT");
migrationBuilder.AlterColumn<string>(
name: "UserId",
table: "AspNetUserTokens",
type: "nvarchar(450)",
nullable: false,
oldClrType: typeof(string),
oldType: "TEXT");
migrationBuilder.AlterColumn<string>(
name: "UserName",
table: "AspNetUsers",
type: "nvarchar(256)",
maxLength: 256,
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 256,
oldNullable: true);
migrationBuilder.AlterColumn<bool>(
name: "TwoFactorEnabled",
table: "AspNetUsers",
type: "bit",
nullable: false,
oldClrType: typeof(bool),
oldType: "INTEGER");
migrationBuilder.AlterColumn<string>(
name: "SecurityStamp",
table: "AspNetUsers",
type: "Text",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
migrationBuilder.AlterColumn<bool>(
name: "PhoneNumberConfirmed",
table: "AspNetUsers",
type: "bit",
nullable: false,
oldClrType: typeof(bool),
oldType: "INTEGER");
migrationBuilder.AlterColumn<string>(
name: "PhoneNumber",
table: "AspNetUsers",
type: "Text",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "PasswordHash",
table: "AspNetUsers",
type: "Text",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "NormalizedUserName",
table: "AspNetUsers",
type: "nvarchar(256)",
maxLength: 256,
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 256,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "NormalizedEmail",
table: "AspNetUsers",
type: "nvarchar(256)",
maxLength: 256,
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 256,
oldNullable: true);
migrationBuilder.AlterColumn<DateTimeOffset>(
name: "LockoutEnd",
table: "AspNetUsers",
type: "datetimeoffset",
nullable: true,
oldClrType: typeof(DateTimeOffset),
oldType: "TEXT",
oldNullable: true);
migrationBuilder.AlterColumn<bool>(
name: "LockoutEnabled",
table: "AspNetUsers",
type: "bit",
nullable: false,
oldClrType: typeof(bool),
oldType: "INTEGER");
migrationBuilder.AlterColumn<bool>(
name: "EmailConfirmed",
table: "AspNetUsers",
type: "bit",
nullable: false,
oldClrType: typeof(bool),
oldType: "INTEGER");
migrationBuilder.AlterColumn<string>(
name: "Email",
table: "AspNetUsers",
type: "nvarchar(256)",
maxLength: 256,
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 256,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AspNetUsers",
type: "Text",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "AccessFailedCount",
table: "AspNetUsers",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "INTEGER");
migrationBuilder.AlterColumn<string>(
name: "Id",
table: "AspNetUsers",
type: "nvarchar(450)",
nullable: false,
oldClrType: typeof(string),
oldType: "TEXT");
migrationBuilder.AlterColumn<string>(
name: "RoleId",
table: "AspNetUserRoles",
type: "nvarchar(450)",
nullable: false,
oldClrType: typeof(string),
oldType: "TEXT");
migrationBuilder.AlterColumn<string>(
name: "UserId",
table: "AspNetUserRoles",
type: "nvarchar(450)",
nullable: false,
oldClrType: typeof(string),
oldType: "TEXT");
migrationBuilder.AlterColumn<string>(
name: "UserId",
table: "AspNetUserLogins",
type: "nvarchar(450)",
nullable: false,
oldClrType: typeof(string),
oldType: "TEXT");
migrationBuilder.AlterColumn<string>(
name: "ProviderDisplayName",
table: "AspNetUserLogins",
type: "Text",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ProviderKey",
table: "AspNetUserLogins",
type: "nvarchar(450)",
nullable: false,
oldClrType: typeof(string),
oldType: "TEXT");
migrationBuilder.AlterColumn<string>(
name: "LoginProvider",
table: "AspNetUserLogins",
type: "nvarchar(450)",
nullable: false,
oldClrType: typeof(string),
oldType: "TEXT");
migrationBuilder.AlterColumn<string>(
name: "UserId",
table: "AspNetUserClaims",
type: "nvarchar(450)",
nullable: false,
oldClrType: typeof(string),
oldType: "TEXT");
migrationBuilder.AlterColumn<string>(
name: "ClaimValue",
table: "AspNetUserClaims",
type: "Text",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ClaimType",
table: "AspNetUserClaims",
type: "Text",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "Id",
table: "AspNetUserClaims",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "INTEGER")
.Annotation("Sqlite:Autoincrement", true)
.OldAnnotation("Sqlite:Autoincrement", true);
migrationBuilder.AlterColumn<string>(
name: "NormalizedName",
table: "AspNetRoles",
type: "nvarchar(256)",
maxLength: 256,
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 256,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Name",
table: "AspNetRoles",
type: "nvarchar(256)",
maxLength: 256,
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldMaxLength: 256,
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ConcurrencyStamp",
table: "AspNetRoles",
type: "Text",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "Id",
table: "AspNetRoles",
type: "nvarchar(450)",
nullable: false,
oldClrType: typeof(string),
oldType: "TEXT");
migrationBuilder.AlterColumn<string>(
name: "RoleId",
table: "AspNetRoleClaims",
type: "nvarchar(450)",
nullable: false,
oldClrType: typeof(string),
oldType: "TEXT");
migrationBuilder.AlterColumn<string>(
name: "ClaimValue",
table: "AspNetRoleClaims",
type: "Text",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ClaimType",
table: "AspNetRoleClaims",
type: "Text",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "Id",
table: "AspNetRoleClaims",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "INTEGER")
.Annotation("Sqlite:Autoincrement", true)
.OldAnnotation("Sqlite:Autoincrement", true);
migrationBuilder.CreateIndex(
name: "UserNameIndex",
table: "AspNetUsers",
column: "NormalizedUserName",
unique: true,
filter: "[NormalizedUserName] IS NOT NULL");
migrationBuilder.CreateIndex(
name: "RoleNameIndex",
table: "AspNetRoles",
column: "NormalizedName",
unique: true,
filter: "[NormalizedName] IS NOT NULL");
}
}
}