diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml
new file mode 100644
index 0000000..9cff650
--- /dev/null
+++ b/.github/workflows/docker-image.yml
@@ -0,0 +1,19 @@
+name: Docker Image CI
+
+on:
+ push:
+ branches:
+ - 'master'
+ - 'dev'
+ pull_request:
+ branches: [ "master" ]
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v3
+ - name: Build the PhoneEdit Docker image
+ working-directory: .
+ run: docker build . --file Dockerfile --tag my-image-name:$(date +%s)
diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml
new file mode 100644
index 0000000..7d86773
--- /dev/null
+++ b/.github/workflows/docker-publish.yml
@@ -0,0 +1,93 @@
+name: Docker Packages
+
+# This workflow uses actions that are not certified by GitHub.
+# They are provided by a third-party and are governed by
+# separate terms of service, privacy policy, and support
+# documentation.
+
+on:
+ release:
+ types: [published]
+
+env:
+ # Use docker.io for Docker Hub if empty
+ REGISTRY: ${{ vars.REGISTRY }}
+
+
+jobs:
+ Build-PhoneEdit:
+ environment: PhoneEditApplication
+
+ runs-on: ubuntu-latest
+
+ permissions:
+ contents: read
+ packages: write
+ # This is used to complete the identity challenge
+ # with sigstore/fulcio when running outside of PRs.
+ id-token: write
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v3
+
+ # Install the cosign tool except on PR
+ # https://github.com/sigstore/cosign-installer
+ - name: Install cosign
+ if: github.event_name != 'pull_request'
+ uses: sigstore/cosign-installer@6e04d228eb30da1757ee4e1dd75a0ec73a653e06 #v3.1.1
+ with:
+ cosign-release: 'v2.1.1'
+
+ # Set up BuildKit Docker container builder to be able to build
+ # multi-platform images and export cache
+ # https://github.com/docker/setup-buildx-action
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
+
+ # Login against a Docker registry except on PR
+ # https://github.com/docker/login-action
+ - name: Log into registry ${{ env.REGISTRY }}
+ if: github.event_name != 'pull_request'
+ uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
+ with:
+ registry: ${{ env.REGISTRY }}
+ username: ${{ github.actor }}
+ password: ${{ secrets.GH_TOKEN }}
+
+ # Extract metadata (tags, labels) for Docker
+ # https://github.com/docker/metadata-action
+ - name: Extract Docker metadata
+ id: meta
+ uses: docker/metadata-action@96383f45573cb7f253c731d3b3ab81c87ef81934 # v5.0.0
+ with:
+ images: ${{ env.REGISTRY }}/${{ github.actor }}/${{ vars.IMAGE_NAME }}
+
+ # Build and push Docker image with Buildx (don't push on PR)
+ # https://github.com/docker/build-push-action
+ - name: Build and push PhoneEdit Docker image
+ id: build-and-push
+ uses: docker/build-push-action@0565240e2d4ab88bba5387d719585280857ece09 # v5.0.0
+ with:
+ context: .
+ push: ${{ github.event_name != 'pull_request' }}
+ tags: ${{ steps.meta.outputs.tags }}
+ labels: ${{ steps.meta.outputs.labels }}
+ cache-from: type=gha
+ cache-to: type=gha,mode=max
+
+ # Sign the resulting Docker image digest except on PRs.
+ # This will only write to the public Rekor transparency log when the Docker
+ # repository is public to avoid leaking data. If you would like to publish
+ # transparency data even for private images, pass --force to cosign below.
+ # https://github.com/sigstore/cosign
+ - name: Sign the published PhoneEdit Docker image
+ if: ${{ github.event_name != 'pull_request' }}
+ env:
+ context: .
+ # https://docs.github.com/en/actions/security-guides/security-hardening-for-github-actions#using-an-intermediate-environment-variable
+ TAGS: ${{ steps.meta.outputs.tags }}
+ DIGEST: ${{ steps.build-and-push.outputs.digest }}
+ # This step uses the identity token to provision an ephemeral certificate
+ # against the sigstore community Fulcio instance.
+ run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml
new file mode 100644
index 0000000..b0e034b
--- /dev/null
+++ b/.github/workflows/dotnet.yml
@@ -0,0 +1,29 @@
+# This workflow will build a .NET project
+
+name: .NET
+
+on:
+ push:
+ branches:
+ - 'master'
+ - 'dev'
+ pull_request:
+ branches: [ "master" ]
+
+jobs:
+ build:
+
+ runs-on: ubuntu-latest
+
+ steps:
+ - uses: actions/checkout@v3
+ - name: Setup .NET
+ uses: actions/setup-dotnet@v3
+ with:
+ dotnet-version: 8.0.x
+ - name: Restore dependencies
+ run: dotnet restore
+ - name: Build
+ run: dotnet build --no-restore
+ - name: Test
+ run: dotnet test --no-build --verbosity normal
diff --git a/.gitignore b/.gitignore
index 6a12ccd..423ea5d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -259,4 +259,9 @@ paket-files/
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
-/appsettings.json
+
+# Custom ignore rules
+.DS_Store
+*.db*
+*.db
+docker-compose.yml
\ No newline at end of file
diff --git a/Areas/Identity/IdentityHostingStartup.cs b/Areas/Identity/IdentityHostingStartup.cs
deleted file mode 100644
index 2373b22..0000000
--- a/Areas/Identity/IdentityHostingStartup.cs
+++ /dev/null
@@ -1,21 +0,0 @@
-using System;
-using Microsoft.AspNetCore.Hosting;
-using Microsoft.AspNetCore.Identity;
-using Microsoft.AspNetCore.Identity.UI;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
-using PhoneEdit.Data;
-
-[assembly: HostingStartup(typeof(PhoneEdit.Areas.Identity.IdentityHostingStartup))]
-namespace PhoneEdit.Areas.Identity
-{
- public class IdentityHostingStartup : IHostingStartup
- {
- public void Configure(IWebHostBuilder builder)
- {
- builder.ConfigureServices((context, services) => {
- });
- }
- }
-}
\ No newline at end of file
diff --git a/Areas/Identity/Pages/Account/Manage/_Layout.cshtml b/Areas/Identity/Pages/Account/Manage/_Layout.cshtml
index de3f8ba..b56456a 100644
--- a/Areas/Identity/Pages/Account/Manage/_Layout.cshtml
+++ b/Areas/Identity/Pages/Account/Manage/_Layout.cshtml
@@ -1,5 +1,5 @@
@{
- Layout = "/Areas/Identity/Pages/_Layout.cshtml";
+ Layout = "_Layout";
}
Manage your account
diff --git a/Controllers/PhoneBookController.cs b/Controllers/PhoneBookController.cs
index 6da2a93..c24cff6 100644
--- a/Controllers/PhoneBookController.cs
+++ b/Controllers/PhoneBookController.cs
@@ -1,11 +1,5 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
using Microsoft.AspNetCore.Authorization;
-using Microsoft.AspNetCore.Authorization.Infrastructure;
using Microsoft.AspNetCore.Mvc;
-using Microsoft.AspNetCore.Mvc.Rendering;
using Microsoft.EntityFrameworkCore;
using PhoneEdit.Data;
using PhoneEdit.Models;
@@ -25,7 +19,7 @@ public PhoneBookController(PhonebookContext context)
// GET: PhoneBook
[AllowAnonymous]
- public async Task Index(string currentFilter, string searchString, int? cPage)
+ public IActionResult Index(string? searchString, string? currentFilter, int? cPage)
{
if (searchString != null)
{
@@ -38,10 +32,8 @@ public async Task Index(string currentFilter, string searchString
ViewBag.CurrentFilter = searchString;
- var entries = from e in _context.Entries
- select e;
-
-
+ var entries = _context.Entries.Select(e => e).AsEnumerable();
+
if (!string.IsNullOrEmpty(searchString))
{
entries = entries.Where(e => e.ToString().Contains(searchString, StringComparison.OrdinalIgnoreCase));
@@ -51,9 +43,10 @@ public async Task Index(string currentFilter, string searchString
int pageSize = 25;
int pageNumber = (cPage ?? 1);
- return View((await entries.ToListAsync()).ToPagedList(pageNumber,pageSize));
- }
+ return View(entries.AsQueryable().ToPagedList(pageNumber, pageSize));
+ }
+
// GET: PhoneBook/Details/5
public async Task Details(int? id)
{
@@ -114,12 +107,9 @@ public async Task Edit(int? id)
return View(bookEntry);
}
- // POST: PhoneBook/Edit/5
- // To protect from overposting attacks, please enable the specific properties you want to bind to, for
- // more details see http://go.microsoft.com/fwlink/?LinkId=317598.
[HttpPost]
[ValidateAntiForgeryToken]
- public async Task Edit(int id, [Bind("Id,PersonnelNumber,Name,Position,Department,LocalPhoneNumber,CityPhoneNumber,Mail,Room, Status")] BookEntry bookEntry)
+ public async Task Edit(int id, [Bind("Id,PersonnelNumber,Name,Position,Department,LocalPhoneNumber,CityPhoneNumber,Mail,Room")] BookEntry bookEntry)
{
if (id != bookEntry.Id)
{
@@ -152,7 +142,7 @@ public async Task Edit(int id, [Bind("Id,PersonnelNumber,Name,Pos
}
return View(bookEntry);
}
-
+
// GET: PhoneBook/Delete/5
public async Task Delete(int? id)
{
@@ -186,8 +176,7 @@ private bool BookEntryExists(int id)
{
return _context.Entries.Any(e => e.Id == id);
}
-
-
+
// Valid only if personnelNumber is unique
private bool VerifyPersonnelNumber(string personnelNumber, int id)
{
diff --git a/Data/ApplicationDbContext.cs b/Data/ApplicationDbContext.cs
index c6acc6a..88354a1 100644
--- a/Data/ApplicationDbContext.cs
+++ b/Data/ApplicationDbContext.cs
@@ -1,16 +1,12 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
+using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
-namespace PhoneEdit.Data
+namespace PhoneEdit.Data;
+
+public class ApplicationDbContext : IdentityDbContext
{
- public class ApplicationDbContext : IdentityDbContext
+ public ApplicationDbContext(DbContextOptions options)
+ : base(options)
{
- public ApplicationDbContext(DbContextOptions options)
- : base(options)
- {
- }
}
}
diff --git a/Data/Migrations/00000000000000_CreateIdentitySchema.Designer.cs b/Data/Migrations/00000000000000_CreateIdentitySchema.Designer.cs
deleted file mode 100644
index 6df8ca1..0000000
--- a/Data/Migrations/00000000000000_CreateIdentitySchema.Designer.cs
+++ /dev/null
@@ -1,229 +0,0 @@
-//
-using System;
-using PhoneEdit.Data;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-
-namespace PhoneEdit.Data.Migrations
-{
- [DbContext(typeof(ApplicationDbContext))]
- [Migration("00000000000000_CreateIdentitySchema")]
- partial class CreateIdentitySchema
- {
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "2.2.0-preview1");
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd();
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken();
-
- b.Property("Name")
- .HasMaxLength(256);
-
- b.Property("NormalizedName")
- .HasMaxLength(256);
-
- b.HasKey("Id");
-
- b.HasIndex("NormalizedName")
- .IsUnique()
- .HasName("RoleNameIndex");
-
- b.ToTable("AspNetRoles");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd();
-
- b.Property("ClaimType");
-
- b.Property("ClaimValue");
-
- b.Property("RoleId")
- .IsRequired();
-
- b.HasKey("Id");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetRoleClaims");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd();
-
- b.Property("AccessFailedCount");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken();
-
- b.Property("Email")
- .HasMaxLength(256);
-
- b.Property("EmailConfirmed");
-
- b.Property("LockoutEnabled");
-
- b.Property("LockoutEnd");
-
- b.Property("NormalizedEmail")
- .HasMaxLength(256);
-
- b.Property("NormalizedUserName")
- .HasMaxLength(256);
-
- b.Property("PasswordHash");
-
- b.Property("PhoneNumber");
-
- b.Property("PhoneNumberConfirmed");
-
- b.Property("SecurityStamp");
-
- b.Property("TwoFactorEnabled");
-
- b.Property("UserName")
- .HasMaxLength(256);
-
- b.HasKey("Id");
-
- b.HasIndex("NormalizedEmail")
- .HasName("EmailIndex");
-
- b.HasIndex("NormalizedUserName")
- .IsUnique()
- .HasName("UserNameIndex");
-
- b.ToTable("AspNetUsers");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
- {
- b.Property("Id")
- .ValueGeneratedOnAdd();
-
- b.Property("ClaimType");
-
- b.Property("ClaimValue");
-
- b.Property("UserId")
- .IsRequired();
-
- b.HasKey("Id");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserClaims");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
- {
- b.Property("LoginProvider")
- .HasMaxLength(128);
-
- b.Property("ProviderKey")
- .HasMaxLength(128);
-
- b.Property("ProviderDisplayName");
-
- b.Property("UserId")
- .IsRequired();
-
- b.HasKey("LoginProvider", "ProviderKey");
-
- b.HasIndex("UserId");
-
- b.ToTable("AspNetUserLogins");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
- {
- b.Property("UserId");
-
- b.Property("RoleId");
-
- b.HasKey("UserId", "RoleId");
-
- b.HasIndex("RoleId");
-
- b.ToTable("AspNetUserRoles");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
- {
- b.Property("UserId");
-
- b.Property("LoginProvider")
- .HasMaxLength(128);
-
- b.Property("Name")
- .HasMaxLength(128);
-
- b.Property("Value");
-
- b.HasKey("UserId", "LoginProvider", "Name");
-
- b.ToTable("AspNetUserTokens");
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole")
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole")
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade);
-
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade);
- });
-
- modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
- {
- b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade);
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/Data/Migrations/20190214095704_BookEntry.Designer.cs b/Data/Migrations/20231127174310_InitPhonebookContextMigration.Designer.cs
similarity index 53%
rename from Data/Migrations/20190214095704_BookEntry.Designer.cs
rename to Data/Migrations/20231127174310_InitPhonebookContextMigration.Designer.cs
index 8d56489..12e427e 100644
--- a/Data/Migrations/20190214095704_BookEntry.Designer.cs
+++ b/Data/Migrations/20231127174310_InitPhonebookContextMigration.Designer.cs
@@ -5,74 +5,76 @@
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using PhoneEdit.Data;
+#nullable disable
+
namespace PhoneEdit.Data.Migrations
{
[DbContext(typeof(PhonebookContext))]
- [Migration("20190214095704_BookEntry")]
- partial class BookEntry
+ [Migration("20231127174310_InitPhonebookContextMigration")]
+ partial class InitPhonebookContextMigration
{
+ ///
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "2.2.2-servicing-10034")
- .HasAnnotation("Relational:MaxIdentifierLength", 64);
+ modelBuilder.HasAnnotation("ProductVersion", "8.0.0");
modelBuilder.Entity("PhoneEdit.Models.BookEntry", b =>
{
b.Property("Id")
.ValueGeneratedOnAdd()
- .HasColumnName("n")
- .HasColumnType("int(11)");
+ .HasColumnType("INTEGER")
+ .HasColumnName("n");
b.Property("CityPhoneNumber")
.IsRequired()
- .HasColumnName("telg")
- .HasColumnType("varchar(100)");
+ .HasColumnType("varchar(100)")
+ .HasColumnName("telg");
b.Property("Department")
.IsRequired()
- .HasColumnName("work")
- .HasColumnType("varchar(250)");
+ .HasColumnType("varchar(250)")
+ .HasColumnName("work");
b.Property("LocalPhoneNumber")
.IsRequired()
- .HasColumnName("telm")
- .HasColumnType("varchar(50)");
+ .HasColumnType("varchar(50)")
+ .HasColumnName("telm");
b.Property("Mail")
.IsRequired()
- .HasColumnName("mail")
- .HasColumnType("varchar(250)");
+ .HasColumnType("varchar(250)")
+ .HasColumnName("mail");
b.Property("Name")
.IsRequired()
- .HasColumnName("name")
- .HasColumnType("varchar(250)");
+ .HasColumnType("varchar(250)")
+ .HasColumnName("name");
b.Property("PersonnelNumber")
.IsRequired()
- .HasColumnName("tabNumber")
- .HasColumnType("varchar(5)");
+ .HasColumnType("varchar(5)")
+ .HasColumnName("tabNumber");
b.Property("Position")
.IsRequired()
- .HasColumnName("who")
- .HasColumnType("varchar(250)");
+ .HasColumnType("varchar(250)")
+ .HasColumnName("who");
b.Property("Room")
.IsRequired()
- .HasColumnName("komnata")
- .HasColumnType("varchar(100)");
+ .HasColumnType("varchar(100)")
+ .HasColumnName("komnata");
b.Property("Status")
- .HasColumnName("status")
- .HasColumnType("varchar(100)");
+ .IsRequired()
+ .HasColumnType("varchar(100)")
+ .HasColumnName("status");
b.HasKey("Id")
.HasName("PRIMARY");
- b.ToTable("tel1");
+ b.ToTable("tel1", (string)null);
});
#pragma warning restore 612, 618
}
diff --git a/Data/Migrations/20190214095704_BookEntry.cs b/Data/Migrations/20231127174310_InitPhonebookContextMigration.cs
similarity index 78%
rename from Data/Migrations/20190214095704_BookEntry.cs
rename to Data/Migrations/20231127174310_InitPhonebookContextMigration.cs
index a50b182..6b27d8b 100644
--- a/Data/Migrations/20190214095704_BookEntry.cs
+++ b/Data/Migrations/20231127174310_InitPhonebookContextMigration.cs
@@ -1,18 +1,21 @@
-using Microsoft.EntityFrameworkCore.Metadata;
-using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
namespace PhoneEdit.Data.Migrations
{
- public partial class BookEntry : Migration
+ ///
+ public partial class InitPhonebookContextMigration : Migration
{
+ ///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "tel1",
columns: table => new
{
- n = table.Column(type: "int(11)", nullable: false)
- .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ n = table.Column(type: "INTEGER", nullable: false)
+ .Annotation("Sqlite:Autoincrement", true),
tabNumber = table.Column(type: "varchar(5)", nullable: false),
name = table.Column(type: "varchar(250)", nullable: false),
who = table.Column(type: "varchar(250)", nullable: false),
@@ -21,7 +24,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
telg = table.Column(type: "varchar(100)", nullable: false),
mail = table.Column(type: "varchar(250)", nullable: false),
komnata = table.Column(type: "varchar(100)", nullable: false),
- status = table.Column(type: "varchar(100)", nullable: true)
+ status = table.Column(type: "varchar(100)", nullable: false)
},
constraints: table =>
{
@@ -29,6 +32,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
});
}
+ ///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
diff --git a/Data/Migrations/20231127180022_InitIdentityMigration.Designer.cs b/Data/Migrations/20231127180022_InitIdentityMigration.Designer.cs
new file mode 100644
index 0000000..e2e3471
--- /dev/null
+++ b/Data/Migrations/20231127180022_InitIdentityMigration.Designer.cs
@@ -0,0 +1,272 @@
+//
+using System;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using PhoneEdit.Data;
+
+#nullable disable
+
+namespace PhoneEdit.Data.Migrations
+{
+ [DbContext(typeof(ApplicationDbContext))]
+ [Migration("20231127180022_InitIdentityMigration")]
+ partial class InitIdentityMigration
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder.HasAnnotation("ProductVersion", "8.0.0");
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("TEXT");
+
+ b.Property("Name")
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
+
+ b.Property("NormalizedName")
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("NormalizedName")
+ .IsUnique()
+ .HasDatabaseName("RoleNameIndex");
+
+ b.ToTable("AspNetRoles", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("ClaimType")
+ .HasColumnType("TEXT");
+
+ b.Property("ClaimValue")
+ .HasColumnType("TEXT");
+
+ b.Property("RoleId")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("AspNetRoleClaims", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
+ {
+ b.Property("Id")
+ .HasColumnType("TEXT");
+
+ b.Property("AccessFailedCount")
+ .HasColumnType("INTEGER");
+
+ b.Property("ConcurrencyStamp")
+ .IsConcurrencyToken()
+ .HasColumnType("TEXT");
+
+ b.Property("Email")
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
+
+ b.Property("EmailConfirmed")
+ .HasColumnType("INTEGER");
+
+ b.Property("LockoutEnabled")
+ .HasColumnType("INTEGER");
+
+ b.Property("LockoutEnd")
+ .HasColumnType("TEXT");
+
+ b.Property("NormalizedEmail")
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
+
+ b.Property("NormalizedUserName")
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
+
+ b.Property("PasswordHash")
+ .HasColumnType("TEXT");
+
+ b.Property("PhoneNumber")
+ .HasColumnType("TEXT");
+
+ b.Property("PhoneNumberConfirmed")
+ .HasColumnType("INTEGER");
+
+ b.Property("SecurityStamp")
+ .HasColumnType("TEXT");
+
+ b.Property("TwoFactorEnabled")
+ .HasColumnType("INTEGER");
+
+ b.Property("UserName")
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("NormalizedEmail")
+ .HasDatabaseName("EmailIndex");
+
+ b.HasIndex("NormalizedUserName")
+ .IsUnique()
+ .HasDatabaseName("UserNameIndex");
+
+ b.ToTable("AspNetUsers", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
+
+ b.Property("ClaimType")
+ .HasColumnType("TEXT");
+
+ b.Property("ClaimValue")
+ .HasColumnType("TEXT");
+
+ b.Property("UserId")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("Id");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("AspNetUserClaims", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
+ {
+ b.Property("LoginProvider")
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("ProviderKey")
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("ProviderDisplayName")
+ .HasColumnType("TEXT");
+
+ b.Property("UserId")
+ .IsRequired()
+ .HasColumnType("TEXT");
+
+ b.HasKey("LoginProvider", "ProviderKey");
+
+ b.HasIndex("UserId");
+
+ b.ToTable("AspNetUserLogins", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("TEXT");
+
+ b.Property("RoleId")
+ .HasColumnType("TEXT");
+
+ b.HasKey("UserId", "RoleId");
+
+ b.HasIndex("RoleId");
+
+ b.ToTable("AspNetUserRoles", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
+ {
+ b.Property("UserId")
+ .HasColumnType("TEXT");
+
+ b.Property("LoginProvider")
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("Name")
+ .HasMaxLength(128)
+ .HasColumnType("TEXT");
+
+ b.Property("Value")
+ .HasColumnType("TEXT");
+
+ b.HasKey("UserId", "LoginProvider", "Name");
+
+ b.ToTable("AspNetUserTokens", (string)null);
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
+ {
+ b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b =>
+ {
+ b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b =>
+ {
+ b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b =>
+ {
+ b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
+ .WithMany()
+ .HasForeignKey("RoleId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+
+ b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+
+ modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b =>
+ {
+ b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
+ .WithMany()
+ .HasForeignKey("UserId")
+ .OnDelete(DeleteBehavior.Cascade)
+ .IsRequired();
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/Data/Migrations/00000000000000_CreateIdentitySchema.cs b/Data/Migrations/20231127180022_InitIdentityMigration.cs
similarity index 65%
rename from Data/Migrations/00000000000000_CreateIdentitySchema.cs
rename to Data/Migrations/20231127180022_InitIdentityMigration.cs
index c75e3ef..a001e90 100644
--- a/Data/Migrations/00000000000000_CreateIdentitySchema.cs
+++ b/Data/Migrations/20231127180022_InitIdentityMigration.cs
@@ -1,20 +1,24 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
+#nullable disable
+
namespace PhoneEdit.Data.Migrations
{
- public partial class CreateIdentitySchema : Migration
+ ///
+ public partial class InitIdentityMigration : Migration
{
+ ///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AspNetRoles",
columns: table => new
{
- Id = table.Column(nullable: false),
- Name = table.Column(maxLength: 256, nullable: true),
- NormalizedName = table.Column(maxLength: 256, nullable: true),
- ConcurrencyStamp = table.Column(nullable: true)
+ Id = table.Column(type: "TEXT", nullable: false),
+ Name = table.Column(type: "TEXT", maxLength: 256, nullable: true),
+ NormalizedName = table.Column(type: "TEXT", maxLength: 256, nullable: true),
+ ConcurrencyStamp = table.Column(type: "TEXT", nullable: true)
},
constraints: table =>
{
@@ -25,21 +29,21 @@ protected override void Up(MigrationBuilder migrationBuilder)
name: "AspNetUsers",
columns: table => new
{
- Id = table.Column(nullable: false),
- UserName = table.Column(maxLength: 256, nullable: true),
- NormalizedUserName = table.Column(maxLength: 256, nullable: true),
- Email = table.Column(maxLength: 256, nullable: true),
- NormalizedEmail = table.Column(maxLength: 256, nullable: true),
- EmailConfirmed = table.Column(nullable: false),
- PasswordHash = table.Column(nullable: true),
- SecurityStamp = table.Column(nullable: true),
- ConcurrencyStamp = table.Column(nullable: true),
- PhoneNumber = table.Column(nullable: true),
- PhoneNumberConfirmed = table.Column(nullable: false),
- TwoFactorEnabled = table.Column(nullable: false),
- LockoutEnd = table.Column(nullable: true),
- LockoutEnabled = table.Column(nullable: false),
- AccessFailedCount = table.Column(nullable: false)
+ Id = table.Column(type: "TEXT", nullable: false),
+ UserName = table.Column(type: "TEXT", maxLength: 256, nullable: true),
+ NormalizedUserName = table.Column(type: "TEXT", maxLength: 256, nullable: true),
+ Email = table.Column(type: "TEXT", maxLength: 256, nullable: true),
+ NormalizedEmail = table.Column(type: "TEXT", maxLength: 256, nullable: true),
+ EmailConfirmed = table.Column(type: "INTEGER", 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: "INTEGER", nullable: false),
+ TwoFactorEnabled = table.Column(type: "INTEGER", nullable: false),
+ LockoutEnd = table.Column(type: "TEXT", nullable: true),
+ LockoutEnabled = table.Column(type: "INTEGER", nullable: false),
+ AccessFailedCount = table.Column(type: "INTEGER", nullable: false)
},
constraints: table =>
{
@@ -50,11 +54,11 @@ protected override void Up(MigrationBuilder migrationBuilder)
name: "AspNetRoleClaims",
columns: table => new
{
- Id = table.Column(nullable: false)
+ Id = table.Column(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
- RoleId = table.Column(nullable: false),
- ClaimType = table.Column(nullable: true),
- ClaimValue = table.Column(nullable: true)
+ RoleId = table.Column(type: "TEXT", nullable: false),
+ ClaimType = table.Column(type: "TEXT", nullable: true),
+ ClaimValue = table.Column(type: "TEXT", nullable: true)
},
constraints: table =>
{
@@ -71,11 +75,11 @@ protected override void Up(MigrationBuilder migrationBuilder)
name: "AspNetUserClaims",
columns: table => new
{
- Id = table.Column(nullable: false)
+ Id = table.Column(type: "INTEGER", nullable: false)
.Annotation("Sqlite:Autoincrement", true),
- UserId = table.Column(nullable: false),
- ClaimType = table.Column(nullable: true),
- ClaimValue = table.Column(nullable: true)
+ UserId = table.Column(type: "TEXT", nullable: false),
+ ClaimType = table.Column(type: "TEXT", nullable: true),
+ ClaimValue = table.Column(type: "TEXT", nullable: true)
},
constraints: table =>
{
@@ -92,10 +96,10 @@ protected override void Up(MigrationBuilder migrationBuilder)
name: "AspNetUserLogins",
columns: table => new
{
- LoginProvider = table.Column(maxLength: 128, nullable: false),
- ProviderKey = table.Column(maxLength: 128, nullable: false),
- ProviderDisplayName = table.Column(nullable: true),
- UserId = table.Column(nullable: false)
+ LoginProvider = table.Column(type: "TEXT", maxLength: 128, nullable: false),
+ ProviderKey = table.Column(type: "TEXT", maxLength: 128, nullable: false),
+ ProviderDisplayName = table.Column(type: "TEXT", nullable: true),
+ UserId = table.Column(type: "TEXT", nullable: false)
},
constraints: table =>
{
@@ -112,8 +116,8 @@ protected override void Up(MigrationBuilder migrationBuilder)
name: "AspNetUserRoles",
columns: table => new
{
- UserId = table.Column(nullable: false),
- RoleId = table.Column(nullable: false)
+ UserId = table.Column(type: "TEXT", nullable: false),
+ RoleId = table.Column(type: "TEXT", nullable: false)
},
constraints: table =>
{
@@ -136,10 +140,10 @@ protected override void Up(MigrationBuilder migrationBuilder)
name: "AspNetUserTokens",
columns: table => new
{
- UserId = table.Column(nullable: false),
- LoginProvider = table.Column(maxLength: 128, nullable: false),
- Name = table.Column(maxLength: 128, nullable: false),
- Value = table.Column(nullable: true)
+ UserId = table.Column(type: "TEXT", nullable: false),
+ LoginProvider = table.Column(type: "TEXT", maxLength: 128, nullable: false),
+ Name = table.Column(type: "TEXT", maxLength: 128, nullable: false),
+ Value = table.Column(type: "TEXT", nullable: true)
},
constraints: table =>
{
@@ -190,6 +194,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
unique: true);
}
+ ///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
diff --git a/Data/Migrations/20231201095725_releaseMigration.Designer.cs b/Data/Migrations/20231201095725_releaseMigration.Designer.cs
new file mode 100644
index 0000000..e69de29
diff --git a/Data/Migrations/20231201095725_releaseMigration.cs b/Data/Migrations/20231201095725_releaseMigration.cs
new file mode 100644
index 0000000..2450a5e
--- /dev/null
+++ b/Data/Migrations/20231201095725_releaseMigration.cs
@@ -0,0 +1,22 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace PhoneEdit.Data.Migrations
+{
+ ///
+ public partial class releaseMigration : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+
+ }
+ }
+}
diff --git a/Data/Migrations/20231201100555_releaseApplicationDbMigration.Designer.cs b/Data/Migrations/20231201100555_releaseApplicationDbMigration.Designer.cs
new file mode 100644
index 0000000..e69de29
diff --git a/Data/Migrations/20231201100555_releaseApplicationDbMigration.cs b/Data/Migrations/20231201100555_releaseApplicationDbMigration.cs
new file mode 100644
index 0000000..e69de29
diff --git a/Data/Migrations/20231201101816_releasePhonebookDbMigration.Designer.cs b/Data/Migrations/20231201101816_releasePhonebookDbMigration.Designer.cs
new file mode 100644
index 0000000..e69de29
diff --git a/Data/Migrations/20231201101816_releasePhonebookDbMigration.cs b/Data/Migrations/20231201101816_releasePhonebookDbMigration.cs
new file mode 100644
index 0000000..d7ef4be
--- /dev/null
+++ b/Data/Migrations/20231201101816_releasePhonebookDbMigration.cs
@@ -0,0 +1,38 @@
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace PhoneEdit.Data.Migrations
+{
+ ///
+ public partial class releasePhonebookDbMigration : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AlterColumn(
+ name: "n",
+ table: "tel1",
+ type: "integer",
+ nullable: false,
+ oldClrType: typeof(int),
+ oldType: "INTEGER")
+ .Annotation("Sqlite:Autoincrement", true)
+ .OldAnnotation("Sqlite:Autoincrement", true);
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AlterColumn(
+ name: "n",
+ table: "tel1",
+ type: "INTEGER",
+ nullable: false,
+ oldClrType: typeof(int),
+ oldType: "integer")
+ .Annotation("Sqlite:Autoincrement", true)
+ .OldAnnotation("Sqlite:Autoincrement", true);
+ }
+ }
+}
diff --git a/Data/Migrations/20231201102233_releasePhonebookMigration.Designer.cs b/Data/Migrations/20231201102233_releasePhonebookMigration.Designer.cs
new file mode 100644
index 0000000..e69de29
diff --git a/Data/Migrations/20231201102233_releasePhonebookMigration.cs b/Data/Migrations/20231201102233_releasePhonebookMigration.cs
new file mode 100644
index 0000000..e69de29
diff --git a/Data/Migrations/20231203125426_releasePbDb.Designer.cs b/Data/Migrations/20231203125426_releasePbDb.Designer.cs
new file mode 100644
index 0000000..102af56
--- /dev/null
+++ b/Data/Migrations/20231203125426_releasePbDb.Designer.cs
@@ -0,0 +1,80 @@
+//
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using PhoneEdit.Data;
+
+#nullable disable
+
+namespace PhoneEdit.Migrations.Phonebook
+{
+ [DbContext(typeof(PhonebookContext))]
+ [Migration("20231203125426_releasePbDb")]
+ partial class releasePbDb
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "8.0.0")
+ .HasAnnotation("Relational:MaxIdentifierLength", 64);
+
+ modelBuilder.Entity("PhoneEdit.Models.BookEntry", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("int(11)")
+ .HasColumnName("n");
+
+ b.Property("CityPhoneNumber")
+ .HasColumnType("varchar(100)")
+ .HasColumnName("telg");
+
+ b.Property("Department")
+ .IsRequired()
+ .HasColumnType("varchar(250)")
+ .HasColumnName("work");
+
+ b.Property("LocalPhoneNumber")
+ .HasColumnType("varchar(50)")
+ .HasColumnName("telm");
+
+ b.Property("Mail")
+ .HasColumnType("varchar(250)")
+ .HasColumnName("mail");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasColumnType("varchar(250)")
+ .HasColumnName("name");
+
+ b.Property("PersonnelNumber")
+ .IsRequired()
+ .HasColumnType("varchar(5)")
+ .HasColumnName("tabNumber");
+
+ b.Property("Position")
+ .IsRequired()
+ .HasColumnType("varchar(250)")
+ .HasColumnName("who");
+
+ b.Property("Room")
+ .HasColumnType("varchar(100)")
+ .HasColumnName("komnata");
+
+ b.Property("Status")
+ .IsRequired()
+ .HasColumnType("varchar(100)")
+ .HasColumnName("status");
+
+ b.HasKey("Id")
+ .HasName("PRIMARY");
+
+ b.ToTable("tel1", (string)null);
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/Data/Migrations/20231203125426_releasePbDb.cs b/Data/Migrations/20231203125426_releasePbDb.cs
new file mode 100644
index 0000000..680f8bf
--- /dev/null
+++ b/Data/Migrations/20231203125426_releasePbDb.cs
@@ -0,0 +1,151 @@
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace PhoneEdit.Migrations.Phonebook
+{
+ ///
+ public partial class releasePbDb : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AlterColumn(
+ name: "telm",
+ table: "tel1",
+ type: "varchar(50)",
+ nullable: true,
+ oldClrType: typeof(string),
+ oldType: "varchar(50)")
+ .Annotation("MySql:CharSet", "utf8mb4")
+ .OldAnnotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.AlterColumn(
+ name: "telg",
+ table: "tel1",
+ type: "varchar(100)",
+ nullable: true,
+ oldClrType: typeof(string),
+ oldType: "varchar(100)")
+ .Annotation("MySql:CharSet", "utf8mb4")
+ .OldAnnotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.AlterColumn(
+ name: "mail",
+ table: "tel1",
+ type: "varchar(250)",
+ nullable: true,
+ oldClrType: typeof(string),
+ oldType: "varchar(250)")
+ .Annotation("MySql:CharSet", "utf8mb4")
+ .OldAnnotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.AlterColumn(
+ name: "komnata",
+ table: "tel1",
+ type: "varchar(100)",
+ nullable: true,
+ oldClrType: typeof(string),
+ oldType: "varchar(100)")
+ .Annotation("MySql:CharSet", "utf8mb4")
+ .OldAnnotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.AlterColumn(
+ name: "n",
+ table: "tel1",
+ type: "int(11)",
+ nullable: false,
+ oldClrType: typeof(int),
+ oldType: "INTEGER")
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
+ .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.UpdateData(
+ table: "tel1",
+ keyColumn: "telm",
+ keyValue: null,
+ column: "telm",
+ value: "");
+
+ migrationBuilder.AlterColumn(
+ name: "telm",
+ table: "tel1",
+ type: "varchar(50)",
+ nullable: false,
+ oldClrType: typeof(string),
+ oldType: "varchar(50)",
+ oldNullable: true)
+ .Annotation("MySql:CharSet", "utf8mb4")
+ .OldAnnotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.UpdateData(
+ table: "tel1",
+ keyColumn: "telg",
+ keyValue: null,
+ column: "telg",
+ value: "");
+
+ migrationBuilder.AlterColumn(
+ name: "telg",
+ table: "tel1",
+ type: "varchar(100)",
+ nullable: false,
+ oldClrType: typeof(string),
+ oldType: "varchar(100)",
+ oldNullable: true)
+ .Annotation("MySql:CharSet", "utf8mb4")
+ .OldAnnotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.UpdateData(
+ table: "tel1",
+ keyColumn: "mail",
+ keyValue: null,
+ column: "mail",
+ value: "");
+
+ migrationBuilder.AlterColumn(
+ name: "mail",
+ table: "tel1",
+ type: "varchar(250)",
+ nullable: false,
+ oldClrType: typeof(string),
+ oldType: "varchar(250)",
+ oldNullable: true)
+ .Annotation("MySql:CharSet", "utf8mb4")
+ .OldAnnotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.UpdateData(
+ table: "tel1",
+ keyColumn: "komnata",
+ keyValue: null,
+ column: "komnata",
+ value: "");
+
+ migrationBuilder.AlterColumn(
+ name: "komnata",
+ table: "tel1",
+ type: "varchar(100)",
+ nullable: false,
+ oldClrType: typeof(string),
+ oldType: "varchar(100)",
+ oldNullable: true)
+ .Annotation("MySql:CharSet", "utf8mb4")
+ .OldAnnotation("MySql:CharSet", "utf8mb4");
+
+ migrationBuilder.AlterColumn(
+ name: "n",
+ table: "tel1",
+ type: "INTEGER",
+ nullable: false,
+ oldClrType: typeof(int),
+ oldType: "int(11)")
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
+ .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
+ }
+ }
+}
diff --git a/Data/Migrations/ApplicationDbContextModelSnapshot.cs b/Data/Migrations/ApplicationDbContextModelSnapshot.cs
index 593e3d7..beef88f 100644
--- a/Data/Migrations/ApplicationDbContextModelSnapshot.cs
+++ b/Data/Migrations/ApplicationDbContextModelSnapshot.cs
@@ -1,9 +1,11 @@
-//
+//
using System;
-using PhoneEdit.Data;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using PhoneEdit.Data;
+
+#nullable disable
namespace PhoneEdit.Data.Migrations
{
@@ -13,213 +15,253 @@ partial class ApplicationDbContextModelSnapshot : ModelSnapshot
protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "2.2.0-preview1");
+ modelBuilder.HasAnnotation("ProductVersion", "8.0.0");
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
{
b.Property("Id")
- .ValueGeneratedOnAdd();
+ .HasColumnType("TEXT");
b.Property("ConcurrencyStamp")
- .IsConcurrencyToken();
+ .IsConcurrencyToken()
+ .HasColumnType("TEXT");
b.Property("Name")
- .HasMaxLength(256);
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
b.Property("NormalizedName")
- .HasMaxLength(256);
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("NormalizedName")
.IsUnique()
- .HasName("RoleNameIndex");
+ .HasDatabaseName("RoleNameIndex");
- b.ToTable("AspNetRoles");
+ b.ToTable("AspNetRoles", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b =>
{
b.Property("Id")
- .ValueGeneratedOnAdd();
+ .ValueGeneratedOnAdd()
+ .HasColumnType("INTEGER");
- b.Property("ClaimType");
+ b.Property("ClaimType")
+ .HasColumnType("TEXT");
- b.Property("ClaimValue");
+ b.Property("ClaimValue")
+ .HasColumnType("TEXT");
b.Property("RoleId")
- .IsRequired();
+ .IsRequired()
+ .HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("RoleId");
- b.ToTable("AspNetRoleClaims");
+ b.ToTable("AspNetRoleClaims", (string)null);
});
modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
{
b.Property("Id")
- .ValueGeneratedOnAdd();
+ .HasColumnType("TEXT");
- b.Property("AccessFailedCount");
+ b.Property("AccessFailedCount")
+ .HasColumnType("INTEGER");
b.Property("ConcurrencyStamp")
- .IsConcurrencyToken();
+ .IsConcurrencyToken()
+ .HasColumnType("TEXT");
b.Property("Email")
- .HasMaxLength(256);
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
- b.Property("EmailConfirmed");
+ b.Property("EmailConfirmed")
+ .HasColumnType("INTEGER");
- b.Property("LockoutEnabled");
+ b.Property("LockoutEnabled")
+ .HasColumnType("INTEGER");
- b.Property("LockoutEnd");
+ b.Property("LockoutEnd")
+ .HasColumnType("TEXT");
b.Property("NormalizedEmail")
- .HasMaxLength(256);
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
b.Property("NormalizedUserName")
- .HasMaxLength(256);
+ .HasMaxLength(256)
+ .HasColumnType("TEXT");
- b.Property("PasswordHash");
+ b.Property("PasswordHash")
+ .HasColumnType("TEXT");
- b.Property("PhoneNumber");
+ b.Property("PhoneNumber")
+ .HasColumnType("TEXT");
- b.Property("PhoneNumberConfirmed");
+ b.Property("PhoneNumberConfirmed")
+ .HasColumnType("INTEGER");
- b.Property("SecurityStamp");
+ b.Property("SecurityStamp")
+ .HasColumnType("TEXT");
- b.Property