diff --git a/BE/Artin.BringAuto.DAL/Artin.BringAuto.DAL.csproj b/BE/Artin.BringAuto.DAL/Artin.BringAuto.DAL.csproj index f1622de..0958992 100644 --- a/BE/Artin.BringAuto.DAL/Artin.BringAuto.DAL.csproj +++ b/BE/Artin.BringAuto.DAL/Artin.BringAuto.DAL.csproj @@ -10,6 +10,7 @@ + diff --git a/BE/Artin.BringAuto.DAL/Migrations/20200917084414_Initial.Designer.cs b/BE/Artin.BringAuto.DAL/Migrations/20200917084414_Initial.Designer.cs deleted file mode 100644 index f0208e9..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20200917084414_Initial.Designer.cs +++ /dev/null @@ -1,386 +0,0 @@ -// -using System; -using Artin.BringAuto.DAL; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Artin.BringAuto.DAL.Migrations -{ - [DbContext(typeof(BringAutoDbContext))] - [Migration("20200917084414_Initial")] - partial class Initial - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.8") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Token") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Cars"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("FromId") - .HasColumnType("int"); - - b.Property("FromStationId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("ToId") - .HasColumnType("int"); - - b.Property("ToStationId") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("FromId"); - - b.HasIndex("ToId"); - - b.HasIndex("UserId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Station", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Stations"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(450)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(450)"); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("Orders") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "From") - .WithMany() - .HasForeignKey("FromId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "To") - .WithMany() - .HasForeignKey("ToId"); - - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId"); - }); - - 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20200917084414_Initial.cs b/BE/Artin.BringAuto.DAL/Migrations/20200917084414_Initial.cs deleted file mode 100644 index e362049..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20200917084414_Initial.cs +++ /dev/null @@ -1,324 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Artin.BringAuto.DAL.Migrations -{ - public partial class Initial : 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) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetRoles", x => x.Id); - }); - - migrationBuilder.CreateTable( - 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) - }, - constraints: table => - { - table.PrimaryKey("PK_AspNetUsers", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Cars", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Token = table.Column(nullable: true), - Name = table.Column(nullable: true), - Latitude = table.Column(nullable: false), - Longitude = table.Column(nullable: false), - Status = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Cars", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Stations", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Name = table.Column(nullable: true), - Latitude = table.Column(nullable: false), - Longitude = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Stations", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AspNetRoleClaims", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - RoleId = table.Column(nullable: false), - ClaimType = table.Column(nullable: true), - ClaimValue = table.Column(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: "AspNetUserClaims", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - UserId = table.Column(nullable: false), - ClaimType = table.Column(nullable: true), - ClaimValue = table.Column(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(nullable: false), - ProviderKey = table.Column(nullable: false), - ProviderDisplayName = table.Column(nullable: true), - UserId = table.Column(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(nullable: false), - RoleId = table.Column(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(nullable: false), - LoginProvider = table.Column(nullable: false), - Name = table.Column(nullable: false), - Value = table.Column(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: "Orders", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - UserId = table.Column(nullable: true), - CarId = table.Column(nullable: false), - FromStationId = table.Column(nullable: false), - FromId = table.Column(nullable: true), - ToStationId = table.Column(nullable: false), - ToId = table.Column(nullable: true), - Priority = table.Column(nullable: false), - Status = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Orders", x => x.Id); - table.ForeignKey( - name: "FK_Orders_Cars_CarId", - column: x => x.CarId, - principalTable: "Cars", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_Orders_Stations_FromId", - column: x => x.FromId, - principalTable: "Stations", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Orders_Stations_ToId", - column: x => x.ToId, - principalTable: "Stations", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_Orders_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateIndex( - name: "IX_AspNetRoleClaims_RoleId", - table: "AspNetRoleClaims", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "RoleNameIndex", - table: "AspNetRoles", - column: "NormalizedName", - unique: true, - filter: "[NormalizedName] IS NOT NULL"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserClaims_UserId", - table: "AspNetUserClaims", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserLogins_UserId", - table: "AspNetUserLogins", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_AspNetUserRoles_RoleId", - table: "AspNetUserRoles", - column: "RoleId"); - - migrationBuilder.CreateIndex( - name: "EmailIndex", - table: "AspNetUsers", - column: "NormalizedEmail"); - - migrationBuilder.CreateIndex( - name: "UserNameIndex", - table: "AspNetUsers", - column: "NormalizedUserName", - unique: true, - filter: "[NormalizedUserName] IS NOT NULL"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_CarId", - table: "Orders", - column: "CarId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_FromId", - table: "Orders", - column: "FromId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_ToId", - table: "Orders", - column: "ToId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_UserId", - table: "Orders", - column: "UserId"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AspNetRoleClaims"); - - migrationBuilder.DropTable( - name: "AspNetUserClaims"); - - migrationBuilder.DropTable( - name: "AspNetUserLogins"); - - migrationBuilder.DropTable( - name: "AspNetUserRoles"); - - migrationBuilder.DropTable( - name: "AspNetUserTokens"); - - migrationBuilder.DropTable( - name: "Orders"); - - migrationBuilder.DropTable( - name: "AspNetRoles"); - - migrationBuilder.DropTable( - name: "Cars"); - - migrationBuilder.DropTable( - name: "Stations"); - - migrationBuilder.DropTable( - name: "AspNetUsers"); - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20200918081427_Maps.Designer.cs b/BE/Artin.BringAuto.DAL/Migrations/20200918081427_Maps.Designer.cs deleted file mode 100644 index 99b1bd7..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20200918081427_Maps.Designer.cs +++ /dev/null @@ -1,424 +0,0 @@ -// -using System; -using Artin.BringAuto.DAL; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Artin.BringAuto.DAL.Migrations -{ - [DbContext(typeof(BringAutoDbContext))] - [Migration("20200918081427_Maps")] - partial class Maps - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.8") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Token") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Cars"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Map", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Height") - .HasColumnType("int"); - - b.Property("Image") - .HasColumnType("varbinary(max)"); - - b.Property("MaxLatitude") - .HasColumnType("float"); - - b.Property("MaxLongitude") - .HasColumnType("float"); - - b.Property("MinLatitude") - .HasColumnType("float"); - - b.Property("MinLongitude") - .HasColumnType("float"); - - b.Property("Width") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Maps"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("FromId") - .HasColumnType("int"); - - b.Property("FromStationId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsConcurrencyToken() - .HasColumnType("int"); - - b.Property("ToId") - .HasColumnType("int"); - - b.Property("ToStationId") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("FromId"); - - b.HasIndex("ToId"); - - b.HasIndex("UserId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Station", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Stations"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Name") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("Orders") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "From") - .WithMany() - .HasForeignKey("FromId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "To") - .WithMany() - .HasForeignKey("ToId"); - - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId"); - }); - - 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20200918081427_Maps.cs b/BE/Artin.BringAuto.DAL/Migrations/20200918081427_Maps.cs deleted file mode 100644 index ad116cc..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20200918081427_Maps.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Artin.BringAuto.DAL.Migrations -{ - public partial class Maps : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - - - migrationBuilder.CreateTable( - name: "Maps", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Image = table.Column(nullable: true), - Width = table.Column(nullable: false), - Height = table.Column(nullable: false), - MinLongitude = table.Column(nullable: false), - MaxLongitude = table.Column(nullable: false), - MinLatitude = table.Column(nullable: false), - MaxLatitude = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Maps", x => x.Id); - }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "Maps"); - - - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20200918093844_changeMaptype.Designer.cs b/BE/Artin.BringAuto.DAL/Migrations/20200918093844_changeMaptype.Designer.cs deleted file mode 100644 index c4f1f4b..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20200918093844_changeMaptype.Designer.cs +++ /dev/null @@ -1,424 +0,0 @@ -// -using System; -using Artin.BringAuto.DAL; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Artin.BringAuto.DAL.Migrations -{ - [DbContext(typeof(BringAutoDbContext))] - [Migration("20200918093844_changeMaptype")] - partial class changeMaptype - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.8") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Token") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Cars"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Map", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Height") - .HasColumnType("int"); - - b.Property("Image") - .HasColumnType("nvarchar(max)"); - - b.Property("MaxLatitude") - .HasColumnType("float"); - - b.Property("MaxLongitude") - .HasColumnType("float"); - - b.Property("MinLatitude") - .HasColumnType("float"); - - b.Property("MinLongitude") - .HasColumnType("float"); - - b.Property("Width") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Maps"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("FromId") - .HasColumnType("int"); - - b.Property("FromStationId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsConcurrencyToken() - .HasColumnType("int"); - - b.Property("ToId") - .HasColumnType("int"); - - b.Property("ToStationId") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("FromId"); - - b.HasIndex("ToId"); - - b.HasIndex("UserId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Station", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Stations"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Name") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("Orders") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "From") - .WithMany() - .HasForeignKey("FromId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "To") - .WithMany() - .HasForeignKey("ToId"); - - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId"); - }); - - 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20200918093844_changeMaptype.cs b/BE/Artin.BringAuto.DAL/Migrations/20200918093844_changeMaptype.cs deleted file mode 100644 index c9dfdd4..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20200918093844_changeMaptype.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Artin.BringAuto.DAL.Migrations -{ - public partial class changeMaptype : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "Image", - table: "Maps", - nullable: true, - oldClrType: typeof(byte[]), - oldType: "varbinary(max)", - oldNullable: true); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "Image", - table: "Maps", - type: "varbinary(max)", - nullable: true, - oldClrType: typeof(string), - oldNullable: true); - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20200930062444_OrderStations.Designer.cs b/BE/Artin.BringAuto.DAL/Migrations/20200930062444_OrderStations.Designer.cs deleted file mode 100644 index 4e4ef8f..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20200930062444_OrderStations.Designer.cs +++ /dev/null @@ -1,422 +0,0 @@ -// -using System; -using Artin.BringAuto.DAL; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Artin.BringAuto.DAL.Migrations -{ - [DbContext(typeof(BringAutoDbContext))] - [Migration("20200930062444_OrderStations")] - partial class OrderStations - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.8") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Token") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Cars"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Map", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Height") - .HasColumnType("int"); - - b.Property("Image") - .HasColumnType("nvarchar(max)"); - - b.Property("MaxLatitude") - .HasColumnType("float"); - - b.Property("MaxLongitude") - .HasColumnType("float"); - - b.Property("MinLatitude") - .HasColumnType("float"); - - b.Property("MinLongitude") - .HasColumnType("float"); - - b.Property("Width") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Maps"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("FromStationId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .IsConcurrencyToken() - .HasColumnType("int"); - - b.Property("ToStationId") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("FromStationId"); - - b.HasIndex("ToStationId"); - - b.HasIndex("UserId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Station", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Stations"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Name") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("Orders") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "FromStation") - .WithMany() - .HasForeignKey("FromStationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "ToStation") - .WithMany() - .HasForeignKey("ToStationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId"); - }); - - 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20200930062444_OrderStations.cs b/BE/Artin.BringAuto.DAL/Migrations/20200930062444_OrderStations.cs deleted file mode 100644 index 2203201..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20200930062444_OrderStations.cs +++ /dev/null @@ -1,117 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Artin.BringAuto.DAL.Migrations -{ - public partial class OrderStations : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Orders_Stations_FromId", - table: "Orders"); - - migrationBuilder.DropForeignKey( - name: "FK_Orders_Stations_ToId", - table: "Orders"); - - migrationBuilder.DropIndex( - name: "IX_Orders_FromId", - table: "Orders"); - - migrationBuilder.DropIndex( - name: "IX_Orders_ToId", - table: "Orders"); - - migrationBuilder.DropColumn( - name: "FromId", - table: "Orders"); - - migrationBuilder.DropColumn( - name: "ToId", - table: "Orders"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_FromStationId", - table: "Orders", - column: "FromStationId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_ToStationId", - table: "Orders", - column: "ToStationId"); - - migrationBuilder.AddForeignKey( - name: "FK_Orders_Stations_FromStationId", - table: "Orders", - column: "FromStationId", - principalTable: "Stations", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_Orders_Stations_ToStationId", - table: "Orders", - column: "ToStationId", - principalTable: "Stations", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Orders_Stations_FromStationId", - table: "Orders"); - - migrationBuilder.DropForeignKey( - name: "FK_Orders_Stations_ToStationId", - table: "Orders"); - - migrationBuilder.DropIndex( - name: "IX_Orders_FromStationId", - table: "Orders"); - - migrationBuilder.DropIndex( - name: "IX_Orders_ToStationId", - table: "Orders"); - - migrationBuilder.AddColumn( - name: "FromId", - table: "Orders", - type: "int", - nullable: true); - - migrationBuilder.AddColumn( - name: "ToId", - table: "Orders", - type: "int", - nullable: true); - - migrationBuilder.CreateIndex( - name: "IX_Orders_FromId", - table: "Orders", - column: "FromId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_ToId", - table: "Orders", - column: "ToId"); - - migrationBuilder.AddForeignKey( - name: "FK_Orders_Stations_FromId", - table: "Orders", - column: "FromId", - principalTable: "Stations", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_Orders_Stations_ToId", - table: "Orders", - column: "ToId", - principalTable: "Stations", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20201014075707_LocationHistory.Designer.cs b/BE/Artin.BringAuto.DAL/Migrations/20201014075707_LocationHistory.Designer.cs deleted file mode 100644 index a02b8b0..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20201014075707_LocationHistory.Designer.cs +++ /dev/null @@ -1,454 +0,0 @@ -// -using System; -using Artin.BringAuto.DAL; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Artin.BringAuto.DAL.Migrations -{ - [DbContext(typeof(BringAutoDbContext))] - [Migration("20201014075707_LocationHistory")] - partial class LocationHistory - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.8") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Token") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Cars"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Time") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("LocationHistory"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Map", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Height") - .HasColumnType("int"); - - b.Property("Image") - .HasColumnType("nvarchar(max)"); - - b.Property("MaxLatitude") - .HasColumnType("float"); - - b.Property("MaxLongitude") - .HasColumnType("float"); - - b.Property("MinLatitude") - .HasColumnType("float"); - - b.Property("MinLongitude") - .HasColumnType("float"); - - b.Property("Width") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Maps"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("FromStationId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("ToStationId") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("FromStationId"); - - b.HasIndex("ToStationId"); - - b.HasIndex("UserId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Station", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Stations"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Name") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("LocationHistoriy") - .HasForeignKey("CarId"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("Orders") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "FromStation") - .WithMany() - .HasForeignKey("FromStationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "ToStation") - .WithMany() - .HasForeignKey("ToStationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId"); - }); - - 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20201014075707_LocationHistory.cs b/BE/Artin.BringAuto.DAL/Migrations/20201014075707_LocationHistory.cs deleted file mode 100644 index cf052ad..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20201014075707_LocationHistory.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Artin.BringAuto.DAL.Migrations -{ - public partial class LocationHistory : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "LocationHistory", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - CarId = table.Column(nullable: true), - Time = table.Column(nullable: false), - Latitude = table.Column(nullable: false), - Longitude = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_LocationHistory", x => x.Id); - table.ForeignKey( - name: "FK_LocationHistory_Cars_CarId", - column: x => x.CarId, - principalTable: "Cars", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateIndex( - name: "IX_LocationHistory_CarId", - table: "LocationHistory", - column: "CarId"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "LocationHistory"); - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20201019043025_ButtonStatus.Designer.cs b/BE/Artin.BringAuto.DAL/Migrations/20201019043025_ButtonStatus.Designer.cs deleted file mode 100644 index 9f23bb3..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20201019043025_ButtonStatus.Designer.cs +++ /dev/null @@ -1,491 +0,0 @@ -// -using System; -using Artin.BringAuto.DAL; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Artin.BringAuto.DAL.Migrations -{ - [DbContext(typeof(BringAutoDbContext))] - [Migration("20201019043025_ButtonStatus")] - partial class ButtonStatus - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.8") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("ButtonStates"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Button") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Token") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Cars"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Time") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("LocationHistory"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Map", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Height") - .HasColumnType("int"); - - b.Property("Image") - .HasColumnType("nvarchar(max)"); - - b.Property("MaxLatitude") - .HasColumnType("float"); - - b.Property("MaxLongitude") - .HasColumnType("float"); - - b.Property("MinLatitude") - .HasColumnType("float"); - - b.Property("MinLongitude") - .HasColumnType("float"); - - b.Property("Width") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Maps"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("FromStationId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("ToStationId") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("FromStationId"); - - b.HasIndex("ToStationId"); - - b.HasIndex("UserId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Station", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Stations"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Name") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany() - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("LocationHistoriy") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("Orders") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "FromStation") - .WithMany() - .HasForeignKey("FromStationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "ToStation") - .WithMany() - .HasForeignKey("ToStationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId"); - }); - - 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20201019043025_ButtonStatus.cs b/BE/Artin.BringAuto.DAL/Migrations/20201019043025_ButtonStatus.cs deleted file mode 100644 index 5bafcff..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20201019043025_ButtonStatus.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Artin.BringAuto.DAL.Migrations -{ - public partial class ButtonStatus : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_LocationHistory_Cars_CarId", - table: "LocationHistory"); - - migrationBuilder.AlterColumn( - name: "CarId", - table: "LocationHistory", - nullable: false, - oldClrType: typeof(int), - oldType: "int", - oldNullable: true); - - migrationBuilder.AddColumn( - name: "Button", - table: "Cars", - nullable: false, - defaultValue: 0); - - migrationBuilder.CreateTable( - name: "ButtonStates", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - DateTime = table.Column(nullable: false), - Status = table.Column(nullable: false), - CarId = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ButtonStates", x => x.Id); - table.ForeignKey( - name: "FK_ButtonStates_Cars_CarId", - column: x => x.CarId, - principalTable: "Cars", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_ButtonStates_CarId", - table: "ButtonStates", - column: "CarId"); - - migrationBuilder.AddForeignKey( - name: "FK_LocationHistory_Cars_CarId", - table: "LocationHistory", - column: "CarId", - principalTable: "Cars", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_LocationHistory_Cars_CarId", - table: "LocationHistory"); - - migrationBuilder.DropTable( - name: "ButtonStates"); - - migrationBuilder.DropColumn( - name: "Button", - table: "Cars"); - - migrationBuilder.AlterColumn( - name: "CarId", - table: "LocationHistory", - type: "int", - nullable: true, - oldClrType: typeof(int)); - - migrationBuilder.AddForeignKey( - name: "FK_LocationHistory_Cars_CarId", - table: "LocationHistory", - column: "CarId", - principalTable: "Cars", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20210521110456_AllowCreateOrderWithoutDestination.Designer.cs b/BE/Artin.BringAuto.DAL/Migrations/20210521110456_AllowCreateOrderWithoutDestination.Designer.cs deleted file mode 100644 index 461e220..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20210521110456_AllowCreateOrderWithoutDestination.Designer.cs +++ /dev/null @@ -1,492 +0,0 @@ -// -using System; -using Artin.BringAuto.DAL; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Artin.BringAuto.DAL.Migrations -{ - [DbContext(typeof(BringAutoDbContext))] - [Migration("20210521110456_AllowCreateOrderWithoutDestination")] - partial class AllowCreateOrderWithoutDestination - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.8") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("ButtonStates"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Button") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Token") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Cars"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Time") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("LocationHistory"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Map", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Height") - .HasColumnType("int"); - - b.Property("Image") - .HasColumnType("nvarchar(max)"); - - b.Property("MaxLatitude") - .HasColumnType("float"); - - b.Property("MaxLongitude") - .HasColumnType("float"); - - b.Property("MinLatitude") - .HasColumnType("float"); - - b.Property("MinLongitude") - .HasColumnType("float"); - - b.Property("Width") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Maps"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Arrive") - .HasColumnType("datetime2"); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("FromStationId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("ToStationId") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("FromStationId"); - - b.HasIndex("ToStationId"); - - b.HasIndex("UserId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Station", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Stations"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Name") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany() - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("LocationHistory") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("Orders") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "FromStation") - .WithMany() - .HasForeignKey("FromStationId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "ToStation") - .WithMany() - .HasForeignKey("ToStationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId"); - }); - - 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20210521110456_AllowCreateOrderWithoutDestination.cs b/BE/Artin.BringAuto.DAL/Migrations/20210521110456_AllowCreateOrderWithoutDestination.cs deleted file mode 100644 index 68add0c..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20210521110456_AllowCreateOrderWithoutDestination.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Artin.BringAuto.DAL.Migrations -{ - public partial class AllowCreateOrderWithoutDestination : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Orders_Stations_FromStationId", - table: "Orders"); - - migrationBuilder.AlterColumn( - name: "FromStationId", - table: "Orders", - nullable: true, - oldClrType: typeof(int), - oldType: "int"); - - migrationBuilder.AddColumn( - name: "Arrive", - table: "Orders", - nullable: true); - - migrationBuilder.AddForeignKey( - name: "FK_Orders_Stations_FromStationId", - table: "Orders", - column: "FromStationId", - principalTable: "Stations", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Orders_Stations_FromStationId", - table: "Orders"); - - migrationBuilder.DropColumn( - name: "Arrive", - table: "Orders"); - - migrationBuilder.AlterColumn( - name: "FromStationId", - table: "Orders", - type: "int", - nullable: false, - oldClrType: typeof(int), - oldNullable: true); - - migrationBuilder.AddForeignKey( - name: "FK_Orders_Stations_FromStationId", - table: "Orders", - column: "FromStationId", - principalTable: "Stations", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20210521110742_AddRoutes.Designer.cs b/BE/Artin.BringAuto.DAL/Migrations/20210521110742_AddRoutes.Designer.cs deleted file mode 100644 index 66002cc..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20210521110742_AddRoutes.Designer.cs +++ /dev/null @@ -1,543 +0,0 @@ -// -using System; -using Artin.BringAuto.DAL; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Artin.BringAuto.DAL.Migrations -{ - [DbContext(typeof(BringAutoDbContext))] - [Migration("20210521110742_AddRoutes")] - partial class AddRoutes - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.8") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("ButtonStates"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Button") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Token") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Cars"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Time") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("LocationHistory"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Map", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Height") - .HasColumnType("int"); - - b.Property("Image") - .HasColumnType("nvarchar(max)"); - - b.Property("MaxLatitude") - .HasColumnType("float"); - - b.Property("MaxLongitude") - .HasColumnType("float"); - - b.Property("MinLatitude") - .HasColumnType("float"); - - b.Property("MinLongitude") - .HasColumnType("float"); - - b.Property("Width") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Maps"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Arrive") - .HasColumnType("datetime2"); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("FromStationId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("ToStationId") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("FromStationId"); - - b.HasIndex("ToStationId"); - - b.HasIndex("UserId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Color") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Routes"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("RouteId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RouteId"); - - b.ToTable("RouteStops"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Station", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Stations"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Name") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany() - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("LocationHistory") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("Orders") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "FromStation") - .WithMany() - .HasForeignKey("FromStationId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "ToStation") - .WithMany() - .HasForeignKey("ToStationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Route", "Route") - .WithMany("Stops") - .HasForeignKey("RouteId"); - }); - - 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20210521110742_AddRoutes.cs b/BE/Artin.BringAuto.DAL/Migrations/20210521110742_AddRoutes.cs deleted file mode 100644 index 4bf2796..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20210521110742_AddRoutes.cs +++ /dev/null @@ -1,60 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Artin.BringAuto.DAL.Migrations -{ - public partial class AddRoutes : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Routes", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Name = table.Column(nullable: true), - Color = table.Column(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Routes", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "RouteStops", - columns: table => new - { - Id = table.Column(nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - RouteId = table.Column(nullable: true), - Latitude = table.Column(nullable: false), - Longitude = table.Column(nullable: false), - Order = table.Column(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_RouteStops", x => x.Id); - table.ForeignKey( - name: "FK_RouteStops_Routes_RouteId", - column: x => x.RouteId, - principalTable: "Routes", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateIndex( - name: "IX_RouteStops_RouteId", - table: "RouteStops", - column: "RouteId"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "RouteStops"); - - migrationBuilder.DropTable( - name: "Routes"); - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20210524085012_HwId.Designer.cs b/BE/Artin.BringAuto.DAL/Migrations/20210524085012_HwId.Designer.cs deleted file mode 100644 index e6d8ece..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20210524085012_HwId.Designer.cs +++ /dev/null @@ -1,546 +0,0 @@ -// -using System; -using Artin.BringAuto.DAL; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Artin.BringAuto.DAL.Migrations -{ - [DbContext(typeof(BringAutoDbContext))] - [Migration("20210524085012_HwId")] - partial class HwId - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.8") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("ButtonStates"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Button") - .HasColumnType("int"); - - b.Property("HwId") - .HasColumnType("nvarchar(max)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Token") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Cars"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Time") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("LocationHistory"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Map", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Height") - .HasColumnType("int"); - - b.Property("Image") - .HasColumnType("nvarchar(max)"); - - b.Property("MaxLatitude") - .HasColumnType("float"); - - b.Property("MaxLongitude") - .HasColumnType("float"); - - b.Property("MinLatitude") - .HasColumnType("float"); - - b.Property("MinLongitude") - .HasColumnType("float"); - - b.Property("Width") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Maps"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Arrive") - .HasColumnType("datetime2"); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("FromStationId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("ToStationId") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("FromStationId"); - - b.HasIndex("ToStationId"); - - b.HasIndex("UserId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Color") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Routes"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("RouteId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RouteId"); - - b.ToTable("RouteStops"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Station", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Stations"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Name") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany() - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("LocationHistory") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("Orders") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "FromStation") - .WithMany() - .HasForeignKey("FromStationId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "ToStation") - .WithMany() - .HasForeignKey("ToStationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Route", "Route") - .WithMany("Stops") - .HasForeignKey("RouteId"); - }); - - 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20210524085012_HwId.cs b/BE/Artin.BringAuto.DAL/Migrations/20210524085012_HwId.cs deleted file mode 100644 index afa0bb4..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20210524085012_HwId.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Artin.BringAuto.DAL.Migrations -{ - public partial class HwId : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "HwId", - table: "Cars", - nullable: true); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "HwId", - table: "Cars"); - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20210524091339_NewValues.Designer.cs b/BE/Artin.BringAuto.DAL/Migrations/20210524091339_NewValues.Designer.cs deleted file mode 100644 index b725f52..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20210524091339_NewValues.Designer.cs +++ /dev/null @@ -1,552 +0,0 @@ -// -using System; -using Artin.BringAuto.DAL; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Artin.BringAuto.DAL.Migrations -{ - [DbContext(typeof(BringAutoDbContext))] - [Migration("20210524091339_NewValues")] - partial class NewValues - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.8") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("ButtonStates"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Button") - .HasColumnType("int"); - - b.Property("Fuel") - .HasColumnType("float"); - - b.Property("HwId") - .HasColumnType("nvarchar(max)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("Speed") - .HasColumnType("float"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Token") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Cars"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Time") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("LocationHistory"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Map", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Height") - .HasColumnType("int"); - - b.Property("Image") - .HasColumnType("nvarchar(max)"); - - b.Property("MaxLatitude") - .HasColumnType("float"); - - b.Property("MaxLongitude") - .HasColumnType("float"); - - b.Property("MinLatitude") - .HasColumnType("float"); - - b.Property("MinLongitude") - .HasColumnType("float"); - - b.Property("Width") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Maps"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Arrive") - .HasColumnType("datetime2"); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("FromStationId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("ToStationId") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("FromStationId"); - - b.HasIndex("ToStationId"); - - b.HasIndex("UserId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Color") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Routes"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("RouteId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RouteId"); - - b.ToTable("RouteStops"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Station", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Stations"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Name") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany() - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("LocationHistory") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("Orders") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "FromStation") - .WithMany() - .HasForeignKey("FromStationId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "ToStation") - .WithMany() - .HasForeignKey("ToStationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Route", "Route") - .WithMany("Stops") - .HasForeignKey("RouteId"); - }); - - 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20210524091339_NewValues.cs b/BE/Artin.BringAuto.DAL/Migrations/20210524091339_NewValues.cs deleted file mode 100644 index be36c98..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20210524091339_NewValues.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Artin.BringAuto.DAL.Migrations -{ - public partial class NewValues : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "Fuel", - table: "Cars", - nullable: false, - defaultValue: 0.0); - - migrationBuilder.AddColumn( - name: "Speed", - table: "Cars", - nullable: false, - defaultValue: 0.0); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Fuel", - table: "Cars"); - - migrationBuilder.DropColumn( - name: "Speed", - table: "Cars"); - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20210915080930_AddCompanyNameToCar.Designer.cs b/BE/Artin.BringAuto.DAL/Migrations/20210915080930_AddCompanyNameToCar.Designer.cs deleted file mode 100644 index 382780a..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20210915080930_AddCompanyNameToCar.Designer.cs +++ /dev/null @@ -1,555 +0,0 @@ -// -using System; -using Artin.BringAuto.DAL; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Artin.BringAuto.DAL.Migrations -{ - [DbContext(typeof(BringAutoDbContext))] - [Migration("20210915080930_AddCompanyNameToCar")] - partial class AddCompanyNameToCar - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.8") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("ButtonStates"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Button") - .HasColumnType("int"); - - b.Property("CompanyName") - .HasColumnType("nvarchar(max)"); - - b.Property("Fuel") - .HasColumnType("float"); - - b.Property("HwId") - .HasColumnType("nvarchar(max)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("Speed") - .HasColumnType("float"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Token") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Cars"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Time") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("LocationHistory"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Map", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Height") - .HasColumnType("int"); - - b.Property("Image") - .HasColumnType("nvarchar(max)"); - - b.Property("MaxLatitude") - .HasColumnType("float"); - - b.Property("MaxLongitude") - .HasColumnType("float"); - - b.Property("MinLatitude") - .HasColumnType("float"); - - b.Property("MinLongitude") - .HasColumnType("float"); - - b.Property("Width") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Maps"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Arrive") - .HasColumnType("datetime2"); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("FromStationId") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("ToStationId") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("FromStationId"); - - b.HasIndex("ToStationId"); - - b.HasIndex("UserId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Color") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Routes"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("RouteId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RouteId"); - - b.ToTable("RouteStops"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Station", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Stations"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Name") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany() - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("LocationHistory") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("Orders") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "FromStation") - .WithMany() - .HasForeignKey("FromStationId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "ToStation") - .WithMany() - .HasForeignKey("ToStationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Route", "Route") - .WithMany("Stops") - .HasForeignKey("RouteId"); - }); - - 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20210915080930_AddCompanyNameToCar.cs b/BE/Artin.BringAuto.DAL/Migrations/20210915080930_AddCompanyNameToCar.cs deleted file mode 100644 index 61a648a..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20210915080930_AddCompanyNameToCar.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Artin.BringAuto.DAL.Migrations -{ - public partial class AddCompanyNameToCar : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "CompanyName", - table: "Cars", - nullable: true); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "CompanyName", - table: "Cars"); - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20210915112804_AddStopStatus.Designer.cs b/BE/Artin.BringAuto.DAL/Migrations/20210915112804_AddStopStatus.Designer.cs deleted file mode 100644 index a970bf5..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20210915112804_AddStopStatus.Designer.cs +++ /dev/null @@ -1,564 +0,0 @@ -// -using System; -using Artin.BringAuto.DAL; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Artin.BringAuto.DAL.Migrations -{ - [DbContext(typeof(BringAutoDbContext))] - [Migration("20210915112804_AddStopStatus")] - partial class AddStopStatus - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.8") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("ButtonStates"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Button") - .HasColumnType("int"); - - b.Property("CompanyName") - .HasColumnType("nvarchar(max)"); - - b.Property("Fuel") - .HasColumnType("float"); - - b.Property("HwId") - .HasColumnType("nvarchar(max)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("SessionId") - .HasColumnType("nvarchar(max)"); - - b.Property("Speed") - .HasColumnType("float"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Token") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Cars"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Time") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("LocationHistory"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Map", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Height") - .HasColumnType("int"); - - b.Property("Image") - .HasColumnType("nvarchar(max)"); - - b.Property("MaxLatitude") - .HasColumnType("float"); - - b.Property("MaxLongitude") - .HasColumnType("float"); - - b.Property("MinLatitude") - .HasColumnType("float"); - - b.Property("MinLongitude") - .HasColumnType("float"); - - b.Property("Width") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Maps"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Arrive") - .HasColumnType("datetime2"); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("FromStationId") - .HasColumnType("int"); - - b.Property("FromStationStatus") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("ToStationId") - .HasColumnType("int"); - - b.Property("ToStationStatus") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("FromStationId"); - - b.HasIndex("ToStationId"); - - b.HasIndex("UserId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Color") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Routes"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("RouteId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RouteId"); - - b.ToTable("RouteStops"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Station", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Stations"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Name") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany() - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("LocationHistory") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("Orders") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "FromStation") - .WithMany() - .HasForeignKey("FromStationId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "ToStation") - .WithMany() - .HasForeignKey("ToStationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Route", "Route") - .WithMany("Stops") - .HasForeignKey("RouteId"); - }); - - 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20210915112804_AddStopStatus.cs b/BE/Artin.BringAuto.DAL/Migrations/20210915112804_AddStopStatus.cs deleted file mode 100644 index f29b332..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20210915112804_AddStopStatus.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Artin.BringAuto.DAL.Migrations -{ - public partial class AddStopStatus : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "FromStationStatus", - table: "Orders", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "ToStationStatus", - table: "Orders", - nullable: false, - defaultValue: 0); - - migrationBuilder.AddColumn( - name: "SessionId", - table: "Cars", - nullable: true); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "FromStationStatus", - table: "Orders"); - - migrationBuilder.DropColumn( - name: "ToStationStatus", - table: "Orders"); - - migrationBuilder.DropColumn( - name: "SessionId", - table: "Cars"); - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20210917040303_AddSessionLogged.Designer.cs b/BE/Artin.BringAuto.DAL/Migrations/20210917040303_AddSessionLogged.Designer.cs deleted file mode 100644 index 51d68f5..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20210917040303_AddSessionLogged.Designer.cs +++ /dev/null @@ -1,567 +0,0 @@ -// -using System; -using Artin.BringAuto.DAL; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Artin.BringAuto.DAL.Migrations -{ - [DbContext(typeof(BringAutoDbContext))] - [Migration("20210917040303_AddSessionLogged")] - partial class AddSessionLogged - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.8") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("ButtonStates"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Button") - .HasColumnType("int"); - - b.Property("CompanyName") - .HasColumnType("nvarchar(max)"); - - b.Property("Fuel") - .HasColumnType("float"); - - b.Property("HwId") - .HasColumnType("nvarchar(max)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("SessionId") - .HasColumnType("nvarchar(max)"); - - b.Property("SessionLogged") - .HasColumnType("datetime2"); - - b.Property("Speed") - .HasColumnType("float"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Token") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Cars"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Time") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("LocationHistory"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Map", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Height") - .HasColumnType("int"); - - b.Property("Image") - .HasColumnType("nvarchar(max)"); - - b.Property("MaxLatitude") - .HasColumnType("float"); - - b.Property("MaxLongitude") - .HasColumnType("float"); - - b.Property("MinLatitude") - .HasColumnType("float"); - - b.Property("MinLongitude") - .HasColumnType("float"); - - b.Property("Width") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Maps"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Arrive") - .HasColumnType("datetime2"); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("FromStationId") - .HasColumnType("int"); - - b.Property("FromStationStatus") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("ToStationId") - .HasColumnType("int"); - - b.Property("ToStationStatus") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("FromStationId"); - - b.HasIndex("ToStationId"); - - b.HasIndex("UserId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Color") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Routes"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("RouteId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RouteId"); - - b.ToTable("RouteStops"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Station", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Stations"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Name") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany() - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("LocationHistory") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("Orders") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "FromStation") - .WithMany() - .HasForeignKey("FromStationId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "ToStation") - .WithMany() - .HasForeignKey("ToStationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Route", "Route") - .WithMany("Stops") - .HasForeignKey("RouteId"); - }); - - 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20210917040303_AddSessionLogged.cs b/BE/Artin.BringAuto.DAL/Migrations/20210917040303_AddSessionLogged.cs deleted file mode 100644 index c1f4203..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20210917040303_AddSessionLogged.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Artin.BringAuto.DAL.Migrations -{ - public partial class AddSessionLogged : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "SessionLogged", - table: "Cars", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "SessionLogged", - table: "Cars"); - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20211025055745_FromAndToStationPhone.Designer.cs b/BE/Artin.BringAuto.DAL/Migrations/20211025055745_FromAndToStationPhone.Designer.cs deleted file mode 100644 index 1d90220..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20211025055745_FromAndToStationPhone.Designer.cs +++ /dev/null @@ -1,573 +0,0 @@ -// -using System; -using Artin.BringAuto.DAL; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Artin.BringAuto.DAL.Migrations -{ - [DbContext(typeof(BringAutoDbContext))] - [Migration("20211025055745_FromAndToStationPhone")] - partial class FromAndToStationPhone - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.8") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("ButtonStates"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Button") - .HasColumnType("int"); - - b.Property("CompanyName") - .HasColumnType("nvarchar(max)"); - - b.Property("Fuel") - .HasColumnType("float"); - - b.Property("HwId") - .HasColumnType("nvarchar(max)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("SessionId") - .HasColumnType("nvarchar(max)"); - - b.Property("SessionLogged") - .HasColumnType("datetime2"); - - b.Property("Speed") - .HasColumnType("float"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Token") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Cars"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Time") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("LocationHistory"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Map", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Height") - .HasColumnType("int"); - - b.Property("Image") - .HasColumnType("nvarchar(max)"); - - b.Property("MaxLatitude") - .HasColumnType("float"); - - b.Property("MaxLongitude") - .HasColumnType("float"); - - b.Property("MinLatitude") - .HasColumnType("float"); - - b.Property("MinLongitude") - .HasColumnType("float"); - - b.Property("Width") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Maps"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Arrive") - .HasColumnType("datetime2"); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("FromStationId") - .HasColumnType("int"); - - b.Property("FromStationPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("FromStationStatus") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("ToStationId") - .HasColumnType("int"); - - b.Property("ToStationPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("ToStationStatus") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("FromStationId"); - - b.HasIndex("ToStationId"); - - b.HasIndex("UserId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Color") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Routes"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("RouteId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RouteId"); - - b.ToTable("RouteStops"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Station", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Stations"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Name") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany() - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("LocationHistory") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("Orders") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "FromStation") - .WithMany() - .HasForeignKey("FromStationId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "ToStation") - .WithMany() - .HasForeignKey("ToStationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Route", "Route") - .WithMany("Stops") - .HasForeignKey("RouteId"); - }); - - 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20211025055745_FromAndToStationPhone.cs b/BE/Artin.BringAuto.DAL/Migrations/20211025055745_FromAndToStationPhone.cs deleted file mode 100644 index fb529b7..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20211025055745_FromAndToStationPhone.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Artin.BringAuto.DAL.Migrations -{ - public partial class FromAndToStationPhone : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "FromStationPhone", - table: "Orders", - nullable: true); - - migrationBuilder.AddColumn( - name: "ToStationPhone", - table: "Orders", - nullable: true); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "FromStationPhone", - table: "Orders"); - - migrationBuilder.DropColumn( - name: "ToStationPhone", - table: "Orders"); - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20211025083419_StationWithContactPhone.Designer.cs b/BE/Artin.BringAuto.DAL/Migrations/20211025083419_StationWithContactPhone.Designer.cs deleted file mode 100644 index e36944f..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20211025083419_StationWithContactPhone.Designer.cs +++ /dev/null @@ -1,576 +0,0 @@ -// -using System; -using Artin.BringAuto.DAL; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Artin.BringAuto.DAL.Migrations -{ - [DbContext(typeof(BringAutoDbContext))] - [Migration("20211025083419_StationWithContactPhone")] - partial class StationWithContactPhone - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.8") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("ButtonStates"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Button") - .HasColumnType("int"); - - b.Property("CompanyName") - .HasColumnType("nvarchar(max)"); - - b.Property("Fuel") - .HasColumnType("float"); - - b.Property("HwId") - .HasColumnType("nvarchar(max)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("SessionId") - .HasColumnType("nvarchar(max)"); - - b.Property("SessionLogged") - .HasColumnType("datetime2"); - - b.Property("Speed") - .HasColumnType("float"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Token") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Cars"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Time") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("LocationHistory"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Map", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Height") - .HasColumnType("int"); - - b.Property("Image") - .HasColumnType("nvarchar(max)"); - - b.Property("MaxLatitude") - .HasColumnType("float"); - - b.Property("MaxLongitude") - .HasColumnType("float"); - - b.Property("MinLatitude") - .HasColumnType("float"); - - b.Property("MinLongitude") - .HasColumnType("float"); - - b.Property("Width") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Maps"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Arrive") - .HasColumnType("datetime2"); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("FromStationId") - .HasColumnType("int"); - - b.Property("FromStationPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("FromStationStatus") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("ToStationId") - .HasColumnType("int"); - - b.Property("ToStationPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("ToStationStatus") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("FromStationId"); - - b.HasIndex("ToStationId"); - - b.HasIndex("UserId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Color") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Routes"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("RouteId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RouteId"); - - b.ToTable("RouteStops"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Station", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ContactPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Stations"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Name") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany() - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("LocationHistory") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("Orders") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "FromStation") - .WithMany() - .HasForeignKey("FromStationId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "ToStation") - .WithMany() - .HasForeignKey("ToStationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Route", "Route") - .WithMany("Stops") - .HasForeignKey("RouteId"); - }); - - 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20211025083419_StationWithContactPhone.cs b/BE/Artin.BringAuto.DAL/Migrations/20211025083419_StationWithContactPhone.cs deleted file mode 100644 index 6480dbe..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20211025083419_StationWithContactPhone.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Artin.BringAuto.DAL.Migrations -{ - public partial class StationWithContactPhone : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "ContactPhone", - table: "Stations", - nullable: true); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "ContactPhone", - table: "Stations"); - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20211118050940_CarUnderTest.Designer.cs b/BE/Artin.BringAuto.DAL/Migrations/20211118050940_CarUnderTest.Designer.cs deleted file mode 100644 index 93087c7..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20211118050940_CarUnderTest.Designer.cs +++ /dev/null @@ -1,579 +0,0 @@ -// -using System; -using Artin.BringAuto.DAL; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Artin.BringAuto.DAL.Migrations -{ - [DbContext(typeof(BringAutoDbContext))] - [Migration("20211118050940_CarUnderTest")] - partial class CarUnderTest - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.8") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("ButtonStates"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Button") - .HasColumnType("int"); - - b.Property("CompanyName") - .HasColumnType("nvarchar(max)"); - - b.Property("Fuel") - .HasColumnType("float"); - - b.Property("HwId") - .HasColumnType("nvarchar(max)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("SessionId") - .HasColumnType("nvarchar(max)"); - - b.Property("SessionLogged") - .HasColumnType("datetime2"); - - b.Property("Speed") - .HasColumnType("float"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Token") - .HasColumnType("nvarchar(max)"); - - b.Property("UnderTest") - .HasColumnType("bit"); - - b.HasKey("Id"); - - b.ToTable("Cars"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Time") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("LocationHistory"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Map", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Height") - .HasColumnType("int"); - - b.Property("Image") - .HasColumnType("nvarchar(max)"); - - b.Property("MaxLatitude") - .HasColumnType("float"); - - b.Property("MaxLongitude") - .HasColumnType("float"); - - b.Property("MinLatitude") - .HasColumnType("float"); - - b.Property("MinLongitude") - .HasColumnType("float"); - - b.Property("Width") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Maps"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Arrive") - .HasColumnType("datetime2"); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("FromStationId") - .HasColumnType("int"); - - b.Property("FromStationPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("FromStationStatus") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("ToStationId") - .HasColumnType("int"); - - b.Property("ToStationPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("ToStationStatus") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("FromStationId"); - - b.HasIndex("ToStationId"); - - b.HasIndex("UserId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Color") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Routes"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("RouteId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RouteId"); - - b.ToTable("RouteStops"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Station", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ContactPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Stations"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Name") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany() - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("LocationHistory") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("Orders") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "FromStation") - .WithMany() - .HasForeignKey("FromStationId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "ToStation") - .WithMany() - .HasForeignKey("ToStationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Route", "Route") - .WithMany("Stops") - .HasForeignKey("RouteId"); - }); - - 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20211118050940_CarUnderTest.cs b/BE/Artin.BringAuto.DAL/Migrations/20211118050940_CarUnderTest.cs deleted file mode 100644 index 0e4396e..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20211118050940_CarUnderTest.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Artin.BringAuto.DAL.Migrations -{ - public partial class CarUnderTest : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "UnderTest", - table: "Cars", - nullable: false, - defaultValue: false); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "UnderTest", - table: "Cars"); - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20211118055420_OrderCAll.Designer.cs b/BE/Artin.BringAuto.DAL/Migrations/20211118055420_OrderCAll.Designer.cs deleted file mode 100644 index 605e708..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20211118055420_OrderCAll.Designer.cs +++ /dev/null @@ -1,585 +0,0 @@ -// -using System; -using Artin.BringAuto.DAL; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Artin.BringAuto.DAL.Migrations -{ - [DbContext(typeof(BringAutoDbContext))] - [Migration("20211118055420_OrderCAll")] - partial class OrderCAll - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.8") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("ButtonStates"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Button") - .HasColumnType("int"); - - b.Property("CallTwiml") - .HasColumnType("nvarchar(max)"); - - b.Property("CarAdminPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("CompanyName") - .HasColumnType("nvarchar(max)"); - - b.Property("Fuel") - .HasColumnType("float"); - - b.Property("HwId") - .HasColumnType("nvarchar(max)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("SessionId") - .HasColumnType("nvarchar(max)"); - - b.Property("SessionLogged") - .HasColumnType("datetime2"); - - b.Property("Speed") - .HasColumnType("float"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Token") - .HasColumnType("nvarchar(max)"); - - b.Property("UnderTest") - .HasColumnType("bit"); - - b.HasKey("Id"); - - b.ToTable("Cars"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Time") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("LocationHistory"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Map", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Height") - .HasColumnType("int"); - - b.Property("Image") - .HasColumnType("nvarchar(max)"); - - b.Property("MaxLatitude") - .HasColumnType("float"); - - b.Property("MaxLongitude") - .HasColumnType("float"); - - b.Property("MinLatitude") - .HasColumnType("float"); - - b.Property("MinLongitude") - .HasColumnType("float"); - - b.Property("Width") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Maps"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Arrive") - .HasColumnType("datetime2"); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("FromStationId") - .HasColumnType("int"); - - b.Property("FromStationPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("FromStationStatus") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("ToStationId") - .HasColumnType("int"); - - b.Property("ToStationPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("ToStationStatus") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("FromStationId"); - - b.HasIndex("ToStationId"); - - b.HasIndex("UserId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Color") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Routes"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("RouteId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RouteId"); - - b.ToTable("RouteStops"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Station", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ContactPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Stations"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Name") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany() - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("LocationHistory") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("Orders") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "FromStation") - .WithMany() - .HasForeignKey("FromStationId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "ToStation") - .WithMany() - .HasForeignKey("ToStationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Route", "Route") - .WithMany("Stops") - .HasForeignKey("RouteId"); - }); - - 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20211118055420_OrderCAll.cs b/BE/Artin.BringAuto.DAL/Migrations/20211118055420_OrderCAll.cs deleted file mode 100644 index ce825fc..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20211118055420_OrderCAll.cs +++ /dev/null @@ -1,32 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Artin.BringAuto.DAL.Migrations -{ - public partial class OrderCAll : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "CallTwiml", - table: "Cars", - defaultValue: "New Order", - nullable: true); - - migrationBuilder.AddColumn( - name: "CarAdminPhone", - table: "Cars", - nullable: true); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "CallTwiml", - table: "Cars"); - - migrationBuilder.DropColumn( - name: "CarAdminPhone", - table: "Cars"); - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20211118112919_NewIndexes.Designer.cs b/BE/Artin.BringAuto.DAL/Migrations/20211118112919_NewIndexes.Designer.cs deleted file mode 100644 index f4fd5e6..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20211118112919_NewIndexes.Designer.cs +++ /dev/null @@ -1,589 +0,0 @@ -// -using System; -using Artin.BringAuto.DAL; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Artin.BringAuto.DAL.Migrations -{ - [DbContext(typeof(BringAutoDbContext))] - [Migration("20211118112919_NewIndexes")] - partial class NewIndexes - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("ProductVersion", "3.1.8") - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedUserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("ButtonStates"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Button") - .HasColumnType("int"); - - b.Property("CallTwiml") - .HasColumnType("nvarchar(max)"); - - b.Property("CarAdminPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("CompanyName") - .HasColumnType("nvarchar(max)"); - - b.Property("Fuel") - .HasColumnType("float"); - - b.Property("HwId") - .HasColumnType("nvarchar(max)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("SessionId") - .HasColumnType("nvarchar(max)"); - - b.Property("SessionLogged") - .HasColumnType("datetime2"); - - b.Property("Speed") - .HasColumnType("float"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Token") - .HasColumnType("nvarchar(max)"); - - b.Property("UnderTest") - .HasColumnType("bit"); - - b.HasKey("Id"); - - b.ToTable("Cars"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Time") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("Time"); - - b.HasIndex("Latitude", "Longitude", "Time"); - - b.ToTable("LocationHistory"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Map", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Height") - .HasColumnType("int"); - - b.Property("Image") - .HasColumnType("nvarchar(max)"); - - b.Property("MaxLatitude") - .HasColumnType("float"); - - b.Property("MaxLongitude") - .HasColumnType("float"); - - b.Property("MinLatitude") - .HasColumnType("float"); - - b.Property("MinLongitude") - .HasColumnType("float"); - - b.Property("Width") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Maps"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Arrive") - .HasColumnType("datetime2"); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("FromStationId") - .HasColumnType("int"); - - b.Property("FromStationPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("FromStationStatus") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("ToStationId") - .HasColumnType("int"); - - b.Property("ToStationPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("ToStationStatus") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("FromStationId"); - - b.HasIndex("ToStationId"); - - b.HasIndex("UserId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Color") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Routes"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("RouteId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RouteId"); - - b.ToTable("RouteStops"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Station", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ContactPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Stations"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.Property("NormalizedName") - .HasColumnType("nvarchar(256)") - .HasMaxLength(256); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderKey") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Name") - .HasColumnType("nvarchar(128)") - .HasMaxLength(128); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany() - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("LocationHistory") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("Orders") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "FromStation") - .WithMany() - .HasForeignKey("FromStationId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "ToStation") - .WithMany() - .HasForeignKey("ToStationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Route", "Route") - .WithMany("Stops") - .HasForeignKey("RouteId"); - }); - - 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20211118112919_NewIndexes.cs b/BE/Artin.BringAuto.DAL/Migrations/20211118112919_NewIndexes.cs deleted file mode 100644 index 3fc92fd..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20211118112919_NewIndexes.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Artin.BringAuto.DAL.Migrations -{ - public partial class NewIndexes : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateIndex( - name: "IX_LocationHistory_Time", - table: "LocationHistory", - column: "Time"); - - migrationBuilder.CreateIndex( - name: "IX_LocationHistory_Latitude_Longitude_Time", - table: "LocationHistory", - columns: new[] { "Latitude", "Longitude", "Time" }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_LocationHistory_Time", - table: "LocationHistory"); - - migrationBuilder.DropIndex( - name: "IX_LocationHistory_Latitude_Longitude_Time", - table: "LocationHistory"); - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20211203122918_RouteStopCanContainsStationId.Designer.cs b/BE/Artin.BringAuto.DAL/Migrations/20211203122918_RouteStopCanContainsStationId.Designer.cs deleted file mode 100644 index 4cc1034..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20211203122918_RouteStopCanContainsStationId.Designer.cs +++ /dev/null @@ -1,626 +0,0 @@ -// -using System; -using Artin.BringAuto.DAL; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Artin.BringAuto.DAL.Migrations -{ - [DbContext(typeof(BringAutoDbContext))] - [Migration("20211203122918_RouteStopCanContainsStationId")] - partial class RouteStopCanContainsStationId - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.12") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("ButtonStates"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Button") - .HasColumnType("int"); - - b.Property("CallTwiml") - .HasColumnType("nvarchar(max)"); - - b.Property("CarAdminPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("CompanyName") - .HasColumnType("nvarchar(max)"); - - b.Property("Fuel") - .HasColumnType("float"); - - b.Property("HwId") - .HasColumnType("nvarchar(max)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("SessionId") - .HasColumnType("nvarchar(max)"); - - b.Property("SessionLogged") - .HasColumnType("datetime2"); - - b.Property("Speed") - .HasColumnType("float"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Token") - .HasColumnType("nvarchar(max)"); - - b.Property("UnderTest") - .HasColumnType("bit"); - - b.HasKey("Id"); - - b.ToTable("Cars"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Time") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("Time"); - - b.HasIndex("Latitude", "Longitude", "Time"); - - b.ToTable("LocationHistory"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Map", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Height") - .HasColumnType("int"); - - b.Property("Image") - .HasColumnType("nvarchar(max)"); - - b.Property("MaxLatitude") - .HasColumnType("float"); - - b.Property("MaxLongitude") - .HasColumnType("float"); - - b.Property("MinLatitude") - .HasColumnType("float"); - - b.Property("MinLongitude") - .HasColumnType("float"); - - b.Property("Width") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Maps"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Arrive") - .HasColumnType("datetime2"); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("FromStationId") - .HasColumnType("int"); - - b.Property("FromStationPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("FromStationStatus") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("ToStationId") - .HasColumnType("int"); - - b.Property("ToStationPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("ToStationStatus") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("FromStationId"); - - b.HasIndex("ToStationId"); - - b.HasIndex("UserId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Color") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Routes"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("RouteId") - .HasColumnType("int"); - - b.Property("StationId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RouteId"); - - b.HasIndex("StationId"); - - b.ToTable("RouteStops"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Station", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ContactPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Stations"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("ProviderKey") - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("Name") - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany() - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Car"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("LocationHistory") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Car"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("Orders") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "FromStation") - .WithMany() - .HasForeignKey("FromStationId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "ToStation") - .WithMany() - .HasForeignKey("ToStationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.Navigation("Car"); - - b.Navigation("FromStation"); - - b.Navigation("ToStation"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Route", "Route") - .WithMany("Stops") - .HasForeignKey("RouteId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "Station") - .WithMany() - .HasForeignKey("StationId"); - - b.Navigation("Route"); - - b.Navigation("Station"); - }); - - 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Navigation("LocationHistory"); - - b.Navigation("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Route", b => - { - b.Navigation("Stops"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20211203122918_RouteStopCanContainsStationId.cs b/BE/Artin.BringAuto.DAL/Migrations/20211203122918_RouteStopCanContainsStationId.cs deleted file mode 100644 index 74971b3..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20211203122918_RouteStopCanContainsStationId.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Artin.BringAuto.DAL.Migrations -{ - public partial class RouteStopCanContainsStationId : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "StationId", - table: "RouteStops", - type: "int", - nullable: true); - - migrationBuilder.CreateIndex( - name: "IX_RouteStops_StationId", - table: "RouteStops", - column: "StationId"); - - migrationBuilder.AddForeignKey( - name: "FK_RouteStops_Stations_StationId", - table: "RouteStops", - column: "StationId", - principalTable: "Stations", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_RouteStops_Stations_StationId", - table: "RouteStops"); - - migrationBuilder.DropIndex( - name: "IX_RouteStops_StationId", - table: "RouteStops"); - - migrationBuilder.DropColumn( - name: "StationId", - table: "RouteStops"); - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20211203130532_RouteIdForCar.Designer.cs b/BE/Artin.BringAuto.DAL/Migrations/20211203130532_RouteIdForCar.Designer.cs deleted file mode 100644 index 3f5ada0..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20211203130532_RouteIdForCar.Designer.cs +++ /dev/null @@ -1,640 +0,0 @@ -// -using System; -using Artin.BringAuto.DAL; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Artin.BringAuto.DAL.Migrations -{ - [DbContext(typeof(BringAutoDbContext))] - [Migration("20211203130532_RouteIdForCar")] - partial class RouteIdForCar - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.12") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("ButtonStates"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Button") - .HasColumnType("int"); - - b.Property("CallTwiml") - .HasColumnType("nvarchar(max)"); - - b.Property("CarAdminPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("CompanyName") - .HasColumnType("nvarchar(max)"); - - b.Property("Fuel") - .HasColumnType("float"); - - b.Property("HwId") - .HasColumnType("nvarchar(max)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("RouteId") - .HasColumnType("int"); - - b.Property("SessionId") - .HasColumnType("nvarchar(max)"); - - b.Property("SessionLogged") - .HasColumnType("datetime2"); - - b.Property("Speed") - .HasColumnType("float"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("Token") - .HasColumnType("nvarchar(max)"); - - b.Property("UnderTest") - .HasColumnType("bit"); - - b.HasKey("Id"); - - b.HasIndex("RouteId"); - - b.ToTable("Cars"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Time") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("Time"); - - b.HasIndex("Latitude", "Longitude", "Time"); - - b.ToTable("LocationHistory"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Map", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Height") - .HasColumnType("int"); - - b.Property("Image") - .HasColumnType("nvarchar(max)"); - - b.Property("MaxLatitude") - .HasColumnType("float"); - - b.Property("MaxLongitude") - .HasColumnType("float"); - - b.Property("MinLatitude") - .HasColumnType("float"); - - b.Property("MinLongitude") - .HasColumnType("float"); - - b.Property("Width") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.ToTable("Maps"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Arrive") - .HasColumnType("datetime2"); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("FromStationId") - .HasColumnType("int"); - - b.Property("FromStationPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("FromStationStatus") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("ToStationId") - .HasColumnType("int"); - - b.Property("ToStationPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("ToStationStatus") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("FromStationId"); - - b.HasIndex("ToStationId"); - - b.HasIndex("UserId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Color") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Routes"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("RouteId") - .HasColumnType("int"); - - b.Property("StationId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RouteId"); - - b.HasIndex("StationId"); - - b.ToTable("RouteStops"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Station", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ContactPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Stations"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("ProviderKey") - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("Name") - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany() - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Car"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Route", "Route") - .WithMany() - .HasForeignKey("RouteId"); - - b.Navigation("Route"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("LocationHistory") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Car"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("Orders") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "FromStation") - .WithMany() - .HasForeignKey("FromStationId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "ToStation") - .WithMany() - .HasForeignKey("ToStationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.Navigation("Car"); - - b.Navigation("FromStation"); - - b.Navigation("ToStation"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Route", "Route") - .WithMany("Stops") - .HasForeignKey("RouteId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "Station") - .WithMany() - .HasForeignKey("StationId"); - - b.Navigation("Route"); - - b.Navigation("Station"); - }); - - 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Navigation("LocationHistory"); - - b.Navigation("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Route", b => - { - b.Navigation("Stops"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20211203130532_RouteIdForCar.cs b/BE/Artin.BringAuto.DAL/Migrations/20211203130532_RouteIdForCar.cs deleted file mode 100644 index 3645476..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20211203130532_RouteIdForCar.cs +++ /dev/null @@ -1,44 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Artin.BringAuto.DAL.Migrations -{ - public partial class RouteIdForCar : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "RouteId", - table: "Cars", - type: "int", - nullable: true); - - migrationBuilder.CreateIndex( - name: "IX_Cars_RouteId", - table: "Cars", - column: "RouteId"); - - migrationBuilder.AddForeignKey( - name: "FK_Cars_Routes_RouteId", - table: "Cars", - column: "RouteId", - principalTable: "Routes", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Cars_Routes_RouteId", - table: "Cars"); - - migrationBuilder.DropIndex( - name: "IX_Cars_RouteId", - table: "Cars"); - - migrationBuilder.DropColumn( - name: "RouteId", - table: "Cars"); - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20220216055927_TenancyData.Designer.cs b/BE/Artin.BringAuto.DAL/Migrations/20220216055927_TenancyData.Designer.cs deleted file mode 100644 index 820f555..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20220216055927_TenancyData.Designer.cs +++ /dev/null @@ -1,730 +0,0 @@ -// -using System; -using Artin.BringAuto.DAL; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Artin.BringAuto.DAL.Migrations -{ - [DbContext(typeof(BringAutoDbContext))] - [Migration("20220216055927_TenancyData")] - partial class TenancyData - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.12") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("ButtonStates"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Button") - .HasColumnType("int"); - - b.Property("CallTwiml") - .HasColumnType("nvarchar(max)"); - - b.Property("CarAdminPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("CompanyName") - .HasColumnType("nvarchar(max)"); - - b.Property("Fuel") - .HasColumnType("float"); - - b.Property("HwId") - .HasColumnType("nvarchar(max)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("RouteId") - .HasColumnType("int"); - - b.Property("SessionId") - .HasColumnType("nvarchar(max)"); - - b.Property("SessionLogged") - .HasColumnType("datetime2"); - - b.Property("Speed") - .HasColumnType("float"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("Token") - .HasColumnType("nvarchar(max)"); - - b.Property("UnderTest") - .HasColumnType("bit"); - - b.HasKey("Id"); - - b.HasIndex("RouteId"); - - b.HasIndex("TenantId"); - - b.ToTable("Cars"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Time") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("Time"); - - b.HasIndex("Latitude", "Longitude", "Time"); - - b.ToTable("LocationHistory"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Map", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Height") - .HasColumnType("int"); - - b.Property("Image") - .HasColumnType("nvarchar(max)"); - - b.Property("MaxLatitude") - .HasColumnType("float"); - - b.Property("MaxLongitude") - .HasColumnType("float"); - - b.Property("MinLatitude") - .HasColumnType("float"); - - b.Property("MinLongitude") - .HasColumnType("float"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("Width") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Maps"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Arrive") - .HasColumnType("datetime2"); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("FromStationId") - .HasColumnType("int"); - - b.Property("FromStationPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("FromStationStatus") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("ToStationId") - .HasColumnType("int"); - - b.Property("ToStationPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("ToStationStatus") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("FromStationId"); - - b.HasIndex("TenantId"); - - b.HasIndex("ToStationId"); - - b.HasIndex("UserId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Color") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Routes"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("RouteId") - .HasColumnType("int"); - - b.Property("StationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RouteId"); - - b.HasIndex("StationId"); - - b.HasIndex("TenantId"); - - b.ToTable("RouteStops"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Station", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ContactPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Stations"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Tenants"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("ProviderKey") - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("Name") - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany() - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Car"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Route", "Route") - .WithMany() - .HasForeignKey("RouteId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.Navigation("Route"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("LocationHistory") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Car"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Map", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("Orders") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "FromStation") - .WithMany() - .HasForeignKey("FromStationId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "ToStation") - .WithMany() - .HasForeignKey("ToStationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.Navigation("Car"); - - b.Navigation("FromStation"); - - b.Navigation("Tenant"); - - b.Navigation("ToStation"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Route", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Route", "Route") - .WithMany("Stops") - .HasForeignKey("RouteId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "Station") - .WithMany() - .HasForeignKey("StationId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.Navigation("Route"); - - b.Navigation("Station"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Station", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.Navigation("Tenant"); - }); - - 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Navigation("LocationHistory"); - - b.Navigation("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Route", b => - { - b.Navigation("Stops"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20220216055927_TenancyData.cs b/BE/Artin.BringAuto.DAL/Migrations/20220216055927_TenancyData.cs deleted file mode 100644 index 282f17b..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20220216055927_TenancyData.cs +++ /dev/null @@ -1,215 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Artin.BringAuto.DAL.Migrations -{ - public partial class TenancyData : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "TenantId", - table: "Stations", - type: "int", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "RouteStops", - type: "int", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "Routes", - type: "int", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "Orders", - type: "int", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "Maps", - type: "int", - nullable: true); - - migrationBuilder.AddColumn( - name: "TenantId", - table: "Cars", - type: "int", - nullable: true); - - migrationBuilder.CreateTable( - name: "Tenants", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - Name = table.Column(type: "nvarchar(max)", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Tenants", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_Stations_TenantId", - table: "Stations", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_RouteStops_TenantId", - table: "RouteStops", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_Routes_TenantId", - table: "Routes", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_Orders_TenantId", - table: "Orders", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_Maps_TenantId", - table: "Maps", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_Cars_TenantId", - table: "Cars", - column: "TenantId"); - - migrationBuilder.AddForeignKey( - name: "FK_Cars_Tenants_TenantId", - table: "Cars", - column: "TenantId", - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_Maps_Tenants_TenantId", - table: "Maps", - column: "TenantId", - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_Orders_Tenants_TenantId", - table: "Orders", - column: "TenantId", - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_Routes_Tenants_TenantId", - table: "Routes", - column: "TenantId", - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_RouteStops_Tenants_TenantId", - table: "RouteStops", - column: "TenantId", - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_Stations_Tenants_TenantId", - table: "Stations", - column: "TenantId", - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Cars_Tenants_TenantId", - table: "Cars"); - - migrationBuilder.DropForeignKey( - name: "FK_Maps_Tenants_TenantId", - table: "Maps"); - - migrationBuilder.DropForeignKey( - name: "FK_Orders_Tenants_TenantId", - table: "Orders"); - - migrationBuilder.DropForeignKey( - name: "FK_Routes_Tenants_TenantId", - table: "Routes"); - - migrationBuilder.DropForeignKey( - name: "FK_RouteStops_Tenants_TenantId", - table: "RouteStops"); - - migrationBuilder.DropForeignKey( - name: "FK_Stations_Tenants_TenantId", - table: "Stations"); - - migrationBuilder.DropTable( - name: "Tenants"); - - migrationBuilder.DropIndex( - name: "IX_Stations_TenantId", - table: "Stations"); - - migrationBuilder.DropIndex( - name: "IX_RouteStops_TenantId", - table: "RouteStops"); - - migrationBuilder.DropIndex( - name: "IX_Routes_TenantId", - table: "Routes"); - - migrationBuilder.DropIndex( - name: "IX_Orders_TenantId", - table: "Orders"); - - migrationBuilder.DropIndex( - name: "IX_Maps_TenantId", - table: "Maps"); - - migrationBuilder.DropIndex( - name: "IX_Cars_TenantId", - table: "Cars"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "Stations"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "RouteStops"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "Routes"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "Orders"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "Maps"); - - migrationBuilder.DropColumn( - name: "TenantId", - table: "Cars"); - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20220216065323_UserTenancy.Designer.cs b/BE/Artin.BringAuto.DAL/Migrations/20220216065323_UserTenancy.Designer.cs deleted file mode 100644 index 1a2ee18..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20220216065323_UserTenancy.Designer.cs +++ /dev/null @@ -1,769 +0,0 @@ -// -using System; -using Artin.BringAuto.DAL; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Artin.BringAuto.DAL.Migrations -{ - [DbContext(typeof(BringAutoDbContext))] - [Migration("20220216065323_UserTenancy")] - partial class UserTenancy - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.12") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("ButtonStates"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Button") - .HasColumnType("int"); - - b.Property("CallTwiml") - .HasColumnType("nvarchar(max)"); - - b.Property("CarAdminPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("CompanyName") - .HasColumnType("nvarchar(max)"); - - b.Property("Fuel") - .HasColumnType("float"); - - b.Property("HwId") - .HasColumnType("nvarchar(max)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("RouteId") - .HasColumnType("int"); - - b.Property("SessionId") - .HasColumnType("nvarchar(max)"); - - b.Property("SessionLogged") - .HasColumnType("datetime2"); - - b.Property("Speed") - .HasColumnType("float"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("Token") - .HasColumnType("nvarchar(max)"); - - b.Property("UnderTest") - .HasColumnType("bit"); - - b.HasKey("Id"); - - b.HasIndex("RouteId"); - - b.HasIndex("TenantId"); - - b.ToTable("Cars"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Time") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("Time"); - - b.HasIndex("Latitude", "Longitude", "Time"); - - b.ToTable("LocationHistory"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Map", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Height") - .HasColumnType("int"); - - b.Property("Image") - .HasColumnType("nvarchar(max)"); - - b.Property("MaxLatitude") - .HasColumnType("float"); - - b.Property("MaxLongitude") - .HasColumnType("float"); - - b.Property("MinLatitude") - .HasColumnType("float"); - - b.Property("MinLongitude") - .HasColumnType("float"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("Width") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Maps"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Arrive") - .HasColumnType("datetime2"); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("FromStationId") - .HasColumnType("int"); - - b.Property("FromStationPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("FromStationStatus") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("ToStationId") - .HasColumnType("int"); - - b.Property("ToStationPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("ToStationStatus") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("FromStationId"); - - b.HasIndex("TenantId"); - - b.HasIndex("ToStationId"); - - b.HasIndex("UserId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Color") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Routes"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("RouteId") - .HasColumnType("int"); - - b.Property("StationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RouteId"); - - b.HasIndex("StationId"); - - b.HasIndex("TenantId"); - - b.ToTable("RouteStops"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Station", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ContactPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Stations"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.HasKey("Id"); - - b.ToTable("Tenants"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.UserTenancy", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.HasIndex("UserId"); - - b.ToTable("UserTenancy"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("ProviderKey") - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("Name") - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany() - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Car"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Route", "Route") - .WithMany() - .HasForeignKey("RouteId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.Navigation("Route"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("LocationHistory") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Car"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Map", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("Orders") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "FromStation") - .WithMany() - .HasForeignKey("FromStationId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "ToStation") - .WithMany() - .HasForeignKey("ToStationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.Navigation("Car"); - - b.Navigation("FromStation"); - - b.Navigation("Tenant"); - - b.Navigation("ToStation"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Route", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Route", "Route") - .WithMany("Stops") - .HasForeignKey("RouteId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "Station") - .WithMany() - .HasForeignKey("StationId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.Navigation("Route"); - - b.Navigation("Station"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Station", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.UserTenancy", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.Navigation("Tenant"); - - b.Navigation("User"); - }); - - 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Navigation("LocationHistory"); - - b.Navigation("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Route", b => - { - b.Navigation("Stops"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20220216065323_UserTenancy.cs b/BE/Artin.BringAuto.DAL/Migrations/20220216065323_UserTenancy.cs deleted file mode 100644 index efa7b34..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20220216065323_UserTenancy.cs +++ /dev/null @@ -1,52 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Artin.BringAuto.DAL.Migrations -{ - public partial class UserTenancy : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "UserTenancy", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - UserId = table.Column(type: "nvarchar(450)", nullable: true), - TenantId = table.Column(type: "int", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_UserTenancy", x => x.Id); - table.ForeignKey( - name: "FK_UserTenancy_AspNetUsers_UserId", - column: x => x.UserId, - principalTable: "AspNetUsers", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - table.ForeignKey( - name: "FK_UserTenancy_Tenants_TenantId", - column: x => x.TenantId, - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_UserTenancy_TenantId", - table: "UserTenancy", - column: "TenantId"); - - migrationBuilder.CreateIndex( - name: "IX_UserTenancy_UserId", - table: "UserTenancy", - column: "UserId"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "UserTenancy"); - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20220217115353_CreateUniqueTenantNames.Designer.cs b/BE/Artin.BringAuto.DAL/Migrations/20220217115353_CreateUniqueTenantNames.Designer.cs deleted file mode 100644 index 9f54a62..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20220217115353_CreateUniqueTenantNames.Designer.cs +++ /dev/null @@ -1,773 +0,0 @@ -// -using System; -using Artin.BringAuto.DAL; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Artin.BringAuto.DAL.Migrations -{ - [DbContext(typeof(BringAutoDbContext))] - [Migration("20220217115353_CreateUniqueTenantNames")] - partial class CreateUniqueTenantNames - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.12") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("ButtonStates"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Button") - .HasColumnType("int"); - - b.Property("CallTwiml") - .HasColumnType("nvarchar(max)"); - - b.Property("CarAdminPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("CompanyName") - .HasColumnType("nvarchar(max)"); - - b.Property("Fuel") - .HasColumnType("float"); - - b.Property("HwId") - .HasColumnType("nvarchar(max)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("RouteId") - .HasColumnType("int"); - - b.Property("SessionId") - .HasColumnType("nvarchar(max)"); - - b.Property("SessionLogged") - .HasColumnType("datetime2"); - - b.Property("Speed") - .HasColumnType("float"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("Token") - .HasColumnType("nvarchar(max)"); - - b.Property("UnderTest") - .HasColumnType("bit"); - - b.HasKey("Id"); - - b.HasIndex("RouteId"); - - b.HasIndex("TenantId"); - - b.ToTable("Cars"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Time") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("Time"); - - b.HasIndex("Latitude", "Longitude", "Time"); - - b.ToTable("LocationHistory"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Map", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Height") - .HasColumnType("int"); - - b.Property("Image") - .HasColumnType("nvarchar(max)"); - - b.Property("MaxLatitude") - .HasColumnType("float"); - - b.Property("MaxLongitude") - .HasColumnType("float"); - - b.Property("MinLatitude") - .HasColumnType("float"); - - b.Property("MinLongitude") - .HasColumnType("float"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("Width") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Maps"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Arrive") - .HasColumnType("datetime2"); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("FromStationId") - .HasColumnType("int"); - - b.Property("FromStationPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("FromStationStatus") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("ToStationId") - .HasColumnType("int"); - - b.Property("ToStationPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("ToStationStatus") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("FromStationId"); - - b.HasIndex("TenantId"); - - b.HasIndex("ToStationId"); - - b.HasIndex("UserId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Color") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Routes"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("RouteId") - .HasColumnType("int"); - - b.Property("StationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RouteId"); - - b.HasIndex("StationId"); - - b.HasIndex("TenantId"); - - b.ToTable("RouteStops"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Station", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ContactPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Stations"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasFilter("[Name] IS NOT NULL"); - - b.ToTable("Tenants"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.UserTenancy", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.HasIndex("UserId"); - - b.ToTable("UserTenancy"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("ProviderKey") - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("Name") - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany() - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Car"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Route", "Route") - .WithMany() - .HasForeignKey("RouteId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.Navigation("Route"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("LocationHistory") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Car"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Map", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("Orders") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "FromStation") - .WithMany() - .HasForeignKey("FromStationId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "ToStation") - .WithMany() - .HasForeignKey("ToStationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.Navigation("Car"); - - b.Navigation("FromStation"); - - b.Navigation("Tenant"); - - b.Navigation("ToStation"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Route", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Route", "Route") - .WithMany("Stops") - .HasForeignKey("RouteId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Station", "Station") - .WithMany() - .HasForeignKey("StationId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.Navigation("Route"); - - b.Navigation("Station"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Station", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.UserTenancy", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.Navigation("Tenant"); - - b.Navigation("User"); - }); - - 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Navigation("LocationHistory"); - - b.Navigation("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Route", b => - { - b.Navigation("Stops"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20220217115353_CreateUniqueTenantNames.cs b/BE/Artin.BringAuto.DAL/Migrations/20220217115353_CreateUniqueTenantNames.cs deleted file mode 100644 index d005d40..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20220217115353_CreateUniqueTenantNames.cs +++ /dev/null @@ -1,42 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Artin.BringAuto.DAL.Migrations -{ - public partial class CreateUniqueTenantNames : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn( - name: "Name", - table: "Tenants", - type: "nvarchar(450)", - nullable: true, - oldClrType: typeof(string), - oldType: "nvarchar(max)", - oldNullable: true); - - migrationBuilder.CreateIndex( - name: "IX_Tenants_Name", - table: "Tenants", - column: "Name", - unique: true, - filter: "[Name] IS NOT NULL"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_Tenants_Name", - table: "Tenants"); - - migrationBuilder.AlterColumn( - name: "Name", - table: "Tenants", - type: "nvarchar(max)", - nullable: true, - oldClrType: typeof(string), - oldType: "nvarchar(450)", - oldNullable: true); - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20220812115119_RenameStationToStop.Designer.cs b/BE/Artin.BringAuto.DAL/Migrations/20220812115119_RenameStationToStop.Designer.cs deleted file mode 100644 index af00630..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20220812115119_RenameStationToStop.Designer.cs +++ /dev/null @@ -1,773 +0,0 @@ -// -using System; -using Artin.BringAuto.DAL; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Artin.BringAuto.DAL.Migrations -{ - [DbContext(typeof(BringAutoDbContext))] - [Migration("20220812115119_RenameStationToStop")] - partial class RenameStationToStop - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) - .HasAnnotation("ProductVersion", "5.0.12") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.ApplicationUser", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("AccessFailedCount") - .HasColumnType("int"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Email") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("EmailConfirmed") - .HasColumnType("bit"); - - b.Property("LockoutEnabled") - .HasColumnType("bit"); - - b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); - - b.Property("NormalizedEmail") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedUserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); - - b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); - - b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); - - b.Property("TwoFactorEnabled") - .HasColumnType("bit"); - - b.Property("UserName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedEmail") - .HasDatabaseName("EmailIndex"); - - b.HasIndex("NormalizedUserName") - .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); - - b.ToTable("AspNetUsers"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("DateTime") - .HasColumnType("datetime2"); - - b.Property("Status") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.ToTable("ButtonStates"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Button") - .HasColumnType("int"); - - b.Property("CallTwiml") - .HasColumnType("nvarchar(max)"); - - b.Property("CarAdminPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("CompanyName") - .HasColumnType("nvarchar(max)"); - - b.Property("Fuel") - .HasColumnType("float"); - - b.Property("HwId") - .HasColumnType("nvarchar(max)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("RouteId") - .HasColumnType("int"); - - b.Property("SessionId") - .HasColumnType("nvarchar(max)"); - - b.Property("SessionLogged") - .HasColumnType("datetime2"); - - b.Property("Speed") - .HasColumnType("float"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("Token") - .HasColumnType("nvarchar(max)"); - - b.Property("UnderTest") - .HasColumnType("bit"); - - b.HasKey("Id"); - - b.HasIndex("RouteId"); - - b.HasIndex("TenantId"); - - b.ToTable("Cars"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Time") - .HasColumnType("datetime2"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("Time"); - - b.HasIndex("Latitude", "Longitude", "Time"); - - b.ToTable("LocationHistory"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Map", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Height") - .HasColumnType("int"); - - b.Property("Image") - .HasColumnType("nvarchar(max)"); - - b.Property("MaxLatitude") - .HasColumnType("float"); - - b.Property("MaxLongitude") - .HasColumnType("float"); - - b.Property("MinLatitude") - .HasColumnType("float"); - - b.Property("MinLongitude") - .HasColumnType("float"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("Width") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Maps"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Arrive") - .HasColumnType("datetime2"); - - b.Property("CarId") - .HasColumnType("int"); - - b.Property("FromStationId") - .HasColumnType("int"); - - b.Property("FromStationPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("FromStationStatus") - .HasColumnType("int"); - - b.Property("Priority") - .HasColumnType("int"); - - b.Property("Status") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("ToStationId") - .HasColumnType("int"); - - b.Property("ToStationPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("ToStationStatus") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("CarId"); - - b.HasIndex("FromStationId"); - - b.HasIndex("TenantId"); - - b.HasIndex("ToStationId"); - - b.HasIndex("UserId"); - - b.ToTable("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Route", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Color") - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Routes"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Order") - .HasColumnType("int"); - - b.Property("RouteId") - .HasColumnType("int"); - - b.Property("StationId") - .HasColumnType("int"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("RouteId"); - - b.HasIndex("StationId"); - - b.HasIndex("TenantId"); - - b.ToTable("RouteStops"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Stop", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ContactPhone") - .HasColumnType("nvarchar(max)"); - - b.Property("Latitude") - .HasColumnType("float"); - - b.Property("Longitude") - .HasColumnType("float"); - - b.Property("Name") - .HasColumnType("nvarchar(max)"); - - b.Property("TenantId") - .HasColumnType("int"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.ToTable("Stops"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Tenant", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("Name") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("Name") - .IsUnique() - .HasFilter("[Name] IS NOT NULL"); - - b.ToTable("Tenants"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.UserTenancy", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("TenantId") - .HasColumnType("int"); - - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("TenantId"); - - b.HasIndex("UserId"); - - b.ToTable("UserTenancy"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => - { - b.Property("Id") - .HasColumnType("nvarchar(450)"); - - b.Property("ConcurrencyStamp") - .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); - - b.Property("Name") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.Property("NormalizedName") - .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); - - b.HasKey("Id"); - - b.HasIndex("NormalizedName") - .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); - - b.ToTable("AspNetRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("RoleId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetRoleClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => - { - b.Property("Id") - .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); - - b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); - - b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserClaims"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.Property("LoginProvider") - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("ProviderKey") - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); - - b.Property("UserId") - .IsRequired() - .HasColumnType("nvarchar(450)"); - - b.HasKey("LoginProvider", "ProviderKey"); - - b.HasIndex("UserId"); - - b.ToTable("AspNetUserLogins"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("RoleId") - .HasColumnType("nvarchar(450)"); - - b.HasKey("UserId", "RoleId"); - - b.HasIndex("RoleId"); - - b.ToTable("AspNetUserRoles"); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.Property("UserId") - .HasColumnType("nvarchar(450)"); - - b.Property("LoginProvider") - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("Name") - .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); - - b.Property("Value") - .HasColumnType("nvarchar(max)"); - - b.HasKey("UserId", "LoginProvider", "Name"); - - b.ToTable("AspNetUserTokens"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Button", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany() - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Car"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Route", "Route") - .WithMany() - .HasForeignKey("RouteId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.Navigation("Route"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.LocationHistory", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("LocationHistory") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Car"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Map", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Order", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Car", "Car") - .WithMany("Orders") - .HasForeignKey("CarId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.Stop", "FromStation") - .WithMany() - .HasForeignKey("FromStationId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Stop", "ToStation") - .WithMany() - .HasForeignKey("ToStationId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.Navigation("Car"); - - b.Navigation("FromStation"); - - b.Navigation("Tenant"); - - b.Navigation("ToStation"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Route", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.RouteStop", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Route", "Route") - .WithMany("Stops") - .HasForeignKey("RouteId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Stop", "Station") - .WithMany() - .HasForeignKey("StationId"); - - b.HasOne("Artin.BringAuto.DAL.Models.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.Navigation("Route"); - - b.Navigation("Station"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Stop", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId"); - - b.Navigation("Tenant"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.UserTenancy", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.Tenant", "Tenant") - .WithMany() - .HasForeignKey("TenantId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", "User") - .WithMany() - .HasForeignKey("UserId"); - - b.Navigation("Tenant"); - - b.Navigation("User"); - }); - - 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", 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("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => - { - b.HasOne("Artin.BringAuto.DAL.Models.ApplicationUser", null) - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Car", b => - { - b.Navigation("LocationHistory"); - - b.Navigation("Orders"); - }); - - modelBuilder.Entity("Artin.BringAuto.DAL.Models.Route", b => - { - b.Navigation("Stops"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20220812115119_RenameStationToStop.cs b/BE/Artin.BringAuto.DAL/Migrations/20220812115119_RenameStationToStop.cs deleted file mode 100644 index ae97fd2..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20220812115119_RenameStationToStop.cs +++ /dev/null @@ -1,123 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Artin.BringAuto.DAL.Migrations -{ - public partial class RenameStationToStop : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Orders_Stations_FromStationId", - table: "Orders"); - - migrationBuilder.DropForeignKey( - name: "FK_Orders_Stations_ToStationId", - table: "Orders"); - - migrationBuilder.DropForeignKey( - name: "FK_RouteStops_Stations_StationId", - table: "RouteStops"); - - migrationBuilder.RenameTable(name: "Stations", newName: "Stops"); - - migrationBuilder.CreateIndex( - name: "IX_Stops_TenantId", - table: "Stops", - column: "TenantId"); - - migrationBuilder.AddForeignKey( - name: "FK_Orders_Stops_FromStationId", - table: "Orders", - column: "FromStationId", - principalTable: "Stops", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_Orders_Stops_ToStationId", - table: "Orders", - column: "ToStationId", - principalTable: "Stops", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_RouteStops_Stops_StationId", - table: "RouteStops", - column: "StationId", - principalTable: "Stops", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_Orders_Stops_FromStationId", - table: "Orders"); - - migrationBuilder.DropForeignKey( - name: "FK_Orders_Stops_ToStationId", - table: "Orders"); - - migrationBuilder.DropForeignKey( - name: "FK_RouteStops_Stops_StationId", - table: "RouteStops"); - - migrationBuilder.DropTable( - name: "Stops"); - - migrationBuilder.CreateTable( - name: "Stations", - columns: table => new - { - Id = table.Column(type: "int", nullable: false) - .Annotation("SqlServer:Identity", "1, 1"), - ContactPhone = table.Column(type: "nvarchar(max)", nullable: true), - Latitude = table.Column(type: "float", nullable: false), - Longitude = table.Column(type: "float", nullable: false), - Name = table.Column(type: "nvarchar(max)", nullable: true), - TenantId = table.Column(type: "int", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Stations", x => x.Id); - table.ForeignKey( - name: "FK_Stations_Tenants_TenantId", - column: x => x.TenantId, - principalTable: "Tenants", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateIndex( - name: "IX_Stations_TenantId", - table: "Stations", - column: "TenantId"); - - migrationBuilder.AddForeignKey( - name: "FK_Orders_Stations_FromStationId", - table: "Orders", - column: "FromStationId", - principalTable: "Stations", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_Orders_Stations_ToStationId", - table: "Orders", - column: "ToStationId", - principalTable: "Stations", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_RouteStops_Stations_StationId", - table: "RouteStops", - column: "StationId", - principalTable: "Stations", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20220831064553_SoftDelete.cs b/BE/Artin.BringAuto.DAL/Migrations/20220831064553_SoftDelete.cs deleted file mode 100644 index 20c6e43..0000000 --- a/BE/Artin.BringAuto.DAL/Migrations/20220831064553_SoftDelete.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Artin.BringAuto.DAL.Migrations -{ - public partial class SoftDelete : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "Deleted", - table: "Stops", - type: "bit", - nullable: false, - defaultValue: false); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Deleted", - table: "Stops"); - } - } -} diff --git a/BE/Artin.BringAuto.DAL/Migrations/20220831064553_SoftDelete.Designer.cs b/BE/Artin.BringAuto.DAL/Migrations/20230404044426_initPostgreSQL.Designer.cs similarity index 72% rename from BE/Artin.BringAuto.DAL/Migrations/20220831064553_SoftDelete.Designer.cs rename to BE/Artin.BringAuto.DAL/Migrations/20230404044426_initPostgreSQL.Designer.cs index 5c46b78..f8e2a18 100644 --- a/BE/Artin.BringAuto.DAL/Migrations/20220831064553_SoftDelete.Designer.cs +++ b/BE/Artin.BringAuto.DAL/Migrations/20230404044426_initPostgreSQL.Designer.cs @@ -3,75 +3,75 @@ using Artin.BringAuto.DAL; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace Artin.BringAuto.DAL.Migrations { [DbContext(typeof(BringAutoDbContext))] - [Migration("20220831064553_SoftDelete")] - partial class SoftDelete + [Migration("20230404044426_initPostgreSQL")] + partial class initPostgreSQL { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("Relational:MaxIdentifierLength", 63) .HasAnnotation("ProductVersion", "5.0.12") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); modelBuilder.Entity("Artin.BringAuto.DAL.Models.ApplicationUser", b => { b.Property("Id") - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.Property("AccessFailedCount") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("Email") .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); + .HasColumnType("character varying(256)"); b.Property("EmailConfirmed") - .HasColumnType("bit"); + .HasColumnType("boolean"); b.Property("LockoutEnabled") - .HasColumnType("bit"); + .HasColumnType("boolean"); b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); + .HasColumnType("timestamp with time zone"); b.Property("NormalizedEmail") .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); + .HasColumnType("character varying(256)"); b.Property("NormalizedUserName") .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); + .HasColumnType("character varying(256)"); b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); + .HasColumnType("boolean"); b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("TwoFactorEnabled") - .HasColumnType("bit"); + .HasColumnType("boolean"); b.Property("UserName") .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); + .HasColumnType("character varying(256)"); b.HasKey("Id"); @@ -80,8 +80,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.HasIndex("NormalizedUserName") .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); + .HasDatabaseName("UserNameIndex"); b.ToTable("AspNetUsers"); }); @@ -90,17 +89,17 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("CarId") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("DateTime") - .HasColumnType("datetime2"); + .HasColumnType("timestamp without time zone"); b.Property("Status") - .HasColumnType("int"); + .HasColumnType("integer"); b.HasKey("Id"); @@ -113,59 +112,59 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("Button") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("CallTwiml") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("CarAdminPhone") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("CompanyName") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("Fuel") - .HasColumnType("float"); + .HasColumnType("double precision"); b.Property("HwId") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("Latitude") - .HasColumnType("float"); + .HasColumnType("double precision"); b.Property("Longitude") - .HasColumnType("float"); + .HasColumnType("double precision"); b.Property("Name") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("RouteId") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("SessionId") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("SessionLogged") - .HasColumnType("datetime2"); + .HasColumnType("timestamp without time zone"); b.Property("Speed") - .HasColumnType("float"); + .HasColumnType("double precision"); b.Property("Status") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("TenantId") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("Token") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("UnderTest") - .HasColumnType("bit"); + .HasColumnType("boolean"); b.HasKey("Id"); @@ -180,20 +179,20 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("CarId") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("Latitude") - .HasColumnType("float"); + .HasColumnType("double precision"); b.Property("Longitude") - .HasColumnType("float"); + .HasColumnType("double precision"); b.Property("Time") - .HasColumnType("datetime2"); + .HasColumnType("timestamp without time zone"); b.HasKey("Id"); @@ -210,32 +209,32 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("Height") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("Image") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("MaxLatitude") - .HasColumnType("float"); + .HasColumnType("double precision"); b.Property("MaxLongitude") - .HasColumnType("float"); + .HasColumnType("double precision"); b.Property("MinLatitude") - .HasColumnType("float"); + .HasColumnType("double precision"); b.Property("MinLongitude") - .HasColumnType("float"); + .HasColumnType("double precision"); b.Property("TenantId") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("Width") - .HasColumnType("int"); + .HasColumnType("integer"); b.HasKey("Id"); @@ -248,44 +247,44 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("Arrive") - .HasColumnType("datetime2"); + .HasColumnType("timestamp without time zone"); b.Property("CarId") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("FromStationId") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("FromStationPhone") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("FromStationStatus") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("Priority") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("Status") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("TenantId") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("ToStationId") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("ToStationPhone") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("ToStationStatus") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("UserId") - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.HasKey("Id"); @@ -306,17 +305,17 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("Color") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("Name") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("TenantId") - .HasColumnType("int"); + .HasColumnType("integer"); b.HasKey("Id"); @@ -329,26 +328,26 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("Latitude") - .HasColumnType("float"); + .HasColumnType("double precision"); b.Property("Longitude") - .HasColumnType("float"); + .HasColumnType("double precision"); b.Property("Order") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("RouteId") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("StationId") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("TenantId") - .HasColumnType("int"); + .HasColumnType("integer"); b.HasKey("Id"); @@ -365,26 +364,26 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("ContactPhone") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("Deleted") - .HasColumnType("bit"); + .HasColumnType("boolean"); b.Property("Latitude") - .HasColumnType("float"); + .HasColumnType("double precision"); b.Property("Longitude") - .HasColumnType("float"); + .HasColumnType("double precision"); b.Property("Name") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("TenantId") - .HasColumnType("int"); + .HasColumnType("integer"); b.HasKey("Id"); @@ -397,17 +396,16 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("Name") - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("Name") - .IsUnique() - .HasFilter("[Name] IS NOT NULL"); + .IsUnique(); b.ToTable("Tenants"); }); @@ -416,14 +414,14 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("TenantId") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("UserId") - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.HasKey("Id"); @@ -437,26 +435,25 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => { b.Property("Id") - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("Name") .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); + .HasColumnType("character varying(256)"); b.Property("NormalizedName") .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); + .HasColumnType("character varying(256)"); b.HasKey("Id"); b.HasIndex("NormalizedName") .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); + .HasDatabaseName("RoleNameIndex"); b.ToTable("AspNetRoles"); }); @@ -465,18 +462,18 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("RoleId") .IsRequired() - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.HasKey("Id"); @@ -489,18 +486,18 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("UserId") .IsRequired() - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.HasKey("Id"); @@ -513,18 +510,18 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) { b.Property("LoginProvider") .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); + .HasColumnType("character varying(128)"); b.Property("ProviderKey") .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); + .HasColumnType("character varying(128)"); b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("UserId") .IsRequired() - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.HasKey("LoginProvider", "ProviderKey"); @@ -536,10 +533,10 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => { b.Property("UserId") - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.Property("RoleId") - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.HasKey("UserId", "RoleId"); @@ -551,18 +548,18 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { b.Property("UserId") - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.Property("LoginProvider") .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); + .HasColumnType("character varying(128)"); b.Property("Name") .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); + .HasColumnType("character varying(128)"); b.Property("Value") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.HasKey("UserId", "LoginProvider", "Name"); diff --git a/BE/Artin.BringAuto.DAL/Migrations/20230404044426_initPostgreSQL.cs b/BE/Artin.BringAuto.DAL/Migrations/20230404044426_initPostgreSQL.cs new file mode 100644 index 0000000..3b9aa81 --- /dev/null +++ b/BE/Artin.BringAuto.DAL/Migrations/20230404044426_initPostgreSQL.cs @@ -0,0 +1,633 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +namespace Artin.BringAuto.DAL.Migrations +{ + public partial class initPostgreSQL : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + 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: "AspNetUsers", + columns: table => new + { + Id = table.Column(type: "text", 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: true), + 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); + }); + + migrationBuilder.CreateTable( + name: "Tenants", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "text", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Tenants", x => x.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: "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: "character varying(128)", maxLength: 128, nullable: false), + ProviderKey = table.Column(type: "character varying(128)", maxLength: 128, 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: "character varying(128)", maxLength: 128, nullable: false), + Name = table.Column(type: "character varying(128)", maxLength: 128, 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: "Maps", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Image = table.Column(type: "text", nullable: true), + Width = table.Column(type: "integer", nullable: false), + Height = table.Column(type: "integer", nullable: false), + MinLongitude = table.Column(type: "double precision", nullable: false), + MaxLongitude = table.Column(type: "double precision", nullable: false), + MinLatitude = table.Column(type: "double precision", nullable: false), + MaxLatitude = table.Column(type: "double precision", nullable: false), + TenantId = table.Column(type: "integer", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Maps", x => x.Id); + table.ForeignKey( + name: "FK_Maps_Tenants_TenantId", + column: x => x.TenantId, + principalTable: "Tenants", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Routes", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "text", nullable: true), + Color = table.Column(type: "text", nullable: true), + TenantId = table.Column(type: "integer", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Routes", x => x.Id); + table.ForeignKey( + name: "FK_Routes_Tenants_TenantId", + column: x => x.TenantId, + principalTable: "Tenants", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Stops", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Name = table.Column(type: "text", nullable: true), + Latitude = table.Column(type: "double precision", nullable: false), + Longitude = table.Column(type: "double precision", nullable: false), + ContactPhone = table.Column(type: "text", nullable: true), + TenantId = table.Column(type: "integer", nullable: true), + Deleted = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Stops", x => x.Id); + table.ForeignKey( + name: "FK_Stops_Tenants_TenantId", + column: x => x.TenantId, + principalTable: "Tenants", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "UserTenancy", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + UserId = table.Column(type: "text", nullable: true), + TenantId = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_UserTenancy", x => x.Id); + table.ForeignKey( + name: "FK_UserTenancy_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_UserTenancy_Tenants_TenantId", + column: x => x.TenantId, + principalTable: "Tenants", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Cars", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + HwId = table.Column(type: "text", nullable: true), + Token = table.Column(type: "text", nullable: true), + Name = table.Column(type: "text", nullable: true), + SessionId = table.Column(type: "text", nullable: true), + SessionLogged = table.Column(type: "timestamp without time zone", nullable: false), + CompanyName = table.Column(type: "text", nullable: true), + Latitude = table.Column(type: "double precision", nullable: false), + Longitude = table.Column(type: "double precision", nullable: false), + Fuel = table.Column(type: "double precision", nullable: false), + Speed = table.Column(type: "double precision", nullable: false), + Status = table.Column(type: "integer", nullable: false), + Button = table.Column(type: "integer", nullable: false), + UnderTest = table.Column(type: "boolean", nullable: false), + CarAdminPhone = table.Column(type: "text", nullable: true), + CallTwiml = table.Column(type: "text", nullable: true), + RouteId = table.Column(type: "integer", nullable: true), + TenantId = table.Column(type: "integer", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Cars", x => x.Id); + table.ForeignKey( + name: "FK_Cars_Routes_RouteId", + column: x => x.RouteId, + principalTable: "Routes", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Cars_Tenants_TenantId", + column: x => x.TenantId, + principalTable: "Tenants", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "RouteStops", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + RouteId = table.Column(type: "integer", nullable: true), + Latitude = table.Column(type: "double precision", nullable: false), + Longitude = table.Column(type: "double precision", nullable: false), + Order = table.Column(type: "integer", nullable: false), + StationId = table.Column(type: "integer", nullable: true), + TenantId = table.Column(type: "integer", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_RouteStops", x => x.Id); + table.ForeignKey( + name: "FK_RouteStops_Routes_RouteId", + column: x => x.RouteId, + principalTable: "Routes", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_RouteStops_Stops_StationId", + column: x => x.StationId, + principalTable: "Stops", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_RouteStops_Tenants_TenantId", + column: x => x.TenantId, + principalTable: "Tenants", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "ButtonStates", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + DateTime = table.Column(type: "timestamp without time zone", nullable: false), + Status = table.Column(type: "integer", nullable: false), + CarId = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ButtonStates", x => x.Id); + table.ForeignKey( + name: "FK_ButtonStates_Cars_CarId", + column: x => x.CarId, + principalTable: "Cars", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "LocationHistory", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + CarId = table.Column(type: "integer", nullable: false), + Time = table.Column(type: "timestamp without time zone", nullable: false), + Latitude = table.Column(type: "double precision", nullable: false), + Longitude = table.Column(type: "double precision", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_LocationHistory", x => x.Id); + table.ForeignKey( + name: "FK_LocationHistory_Cars_CarId", + column: x => x.CarId, + principalTable: "Cars", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Orders", + columns: table => new + { + Id = table.Column(type: "integer", nullable: false) + .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn), + Arrive = table.Column(type: "timestamp without time zone", nullable: true), + UserId = table.Column(type: "text", nullable: true), + CarId = table.Column(type: "integer", nullable: false), + FromStationId = table.Column(type: "integer", nullable: true), + ToStationId = table.Column(type: "integer", nullable: false), + Priority = table.Column(type: "integer", nullable: false), + Status = table.Column(type: "integer", nullable: false), + FromStationStatus = table.Column(type: "integer", nullable: false), + ToStationStatus = table.Column(type: "integer", nullable: false), + FromStationPhone = table.Column(type: "text", nullable: true), + ToStationPhone = table.Column(type: "text", nullable: true), + TenantId = table.Column(type: "integer", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Orders", x => x.Id); + table.ForeignKey( + name: "FK_Orders_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Orders_Cars_CarId", + column: x => x.CarId, + principalTable: "Cars", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Orders_Stops_FromStationId", + column: x => x.FromStationId, + principalTable: "Stops", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Orders_Stops_ToStationId", + column: x => x.ToStationId, + principalTable: "Stops", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_Orders_Tenants_TenantId", + column: x => x.TenantId, + principalTable: "Tenants", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateIndex( + name: "IX_AspNetRoleClaims_RoleId", + table: "AspNetRoleClaims", + column: "RoleId"); + + migrationBuilder.CreateIndex( + name: "RoleNameIndex", + table: "AspNetRoles", + column: "NormalizedName", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_AspNetUserClaims_UserId", + table: "AspNetUserClaims", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_AspNetUserLogins_UserId", + table: "AspNetUserLogins", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_AspNetUserRoles_RoleId", + table: "AspNetUserRoles", + column: "RoleId"); + + migrationBuilder.CreateIndex( + name: "EmailIndex", + table: "AspNetUsers", + column: "NormalizedEmail"); + + migrationBuilder.CreateIndex( + name: "UserNameIndex", + table: "AspNetUsers", + column: "NormalizedUserName", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_ButtonStates_CarId", + table: "ButtonStates", + column: "CarId"); + + migrationBuilder.CreateIndex( + name: "IX_Cars_RouteId", + table: "Cars", + column: "RouteId"); + + migrationBuilder.CreateIndex( + name: "IX_Cars_TenantId", + table: "Cars", + column: "TenantId"); + + migrationBuilder.CreateIndex( + name: "IX_LocationHistory_CarId", + table: "LocationHistory", + column: "CarId"); + + migrationBuilder.CreateIndex( + name: "IX_LocationHistory_Latitude_Longitude_Time", + table: "LocationHistory", + columns: new[] { "Latitude", "Longitude", "Time" }); + + migrationBuilder.CreateIndex( + name: "IX_LocationHistory_Time", + table: "LocationHistory", + column: "Time"); + + migrationBuilder.CreateIndex( + name: "IX_Maps_TenantId", + table: "Maps", + column: "TenantId"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_CarId", + table: "Orders", + column: "CarId"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_FromStationId", + table: "Orders", + column: "FromStationId"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_TenantId", + table: "Orders", + column: "TenantId"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_ToStationId", + table: "Orders", + column: "ToStationId"); + + migrationBuilder.CreateIndex( + name: "IX_Orders_UserId", + table: "Orders", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_Routes_TenantId", + table: "Routes", + column: "TenantId"); + + migrationBuilder.CreateIndex( + name: "IX_RouteStops_RouteId", + table: "RouteStops", + column: "RouteId"); + + migrationBuilder.CreateIndex( + name: "IX_RouteStops_StationId", + table: "RouteStops", + column: "StationId"); + + migrationBuilder.CreateIndex( + name: "IX_RouteStops_TenantId", + table: "RouteStops", + column: "TenantId"); + + migrationBuilder.CreateIndex( + name: "IX_Stops_TenantId", + table: "Stops", + column: "TenantId"); + + migrationBuilder.CreateIndex( + name: "IX_Tenants_Name", + table: "Tenants", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_UserTenancy_TenantId", + table: "UserTenancy", + column: "TenantId"); + + migrationBuilder.CreateIndex( + name: "IX_UserTenancy_UserId", + table: "UserTenancy", + column: "UserId"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "AspNetRoleClaims"); + + migrationBuilder.DropTable( + name: "AspNetUserClaims"); + + migrationBuilder.DropTable( + name: "AspNetUserLogins"); + + migrationBuilder.DropTable( + name: "AspNetUserRoles"); + + migrationBuilder.DropTable( + name: "AspNetUserTokens"); + + migrationBuilder.DropTable( + name: "ButtonStates"); + + migrationBuilder.DropTable( + name: "LocationHistory"); + + migrationBuilder.DropTable( + name: "Maps"); + + migrationBuilder.DropTable( + name: "Orders"); + + migrationBuilder.DropTable( + name: "RouteStops"); + + migrationBuilder.DropTable( + name: "UserTenancy"); + + migrationBuilder.DropTable( + name: "AspNetRoles"); + + migrationBuilder.DropTable( + name: "Cars"); + + migrationBuilder.DropTable( + name: "Stops"); + + migrationBuilder.DropTable( + name: "AspNetUsers"); + + migrationBuilder.DropTable( + name: "Routes"); + + migrationBuilder.DropTable( + name: "Tenants"); + } + } +} diff --git a/BE/Artin.BringAuto.DAL/Migrations/BringAutoDbContextModelSnapshot.cs b/BE/Artin.BringAuto.DAL/Migrations/BringAutoDbContextModelSnapshot.cs index cc0516a..b1360a2 100644 --- a/BE/Artin.BringAuto.DAL/Migrations/BringAutoDbContextModelSnapshot.cs +++ b/BE/Artin.BringAuto.DAL/Migrations/BringAutoDbContextModelSnapshot.cs @@ -3,8 +3,8 @@ using Artin.BringAuto.DAL; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; namespace Artin.BringAuto.DAL.Migrations { @@ -15,61 +15,61 @@ protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder - .HasAnnotation("Relational:MaxIdentifierLength", 128) + .HasAnnotation("Relational:MaxIdentifierLength", 63) .HasAnnotation("ProductVersion", "5.0.12") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); modelBuilder.Entity("Artin.BringAuto.DAL.Models.ApplicationUser", b => { b.Property("Id") - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.Property("AccessFailedCount") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("Email") .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); + .HasColumnType("character varying(256)"); b.Property("EmailConfirmed") - .HasColumnType("bit"); + .HasColumnType("boolean"); b.Property("LockoutEnabled") - .HasColumnType("bit"); + .HasColumnType("boolean"); b.Property("LockoutEnd") - .HasColumnType("datetimeoffset"); + .HasColumnType("timestamp with time zone"); b.Property("NormalizedEmail") .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); + .HasColumnType("character varying(256)"); b.Property("NormalizedUserName") .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); + .HasColumnType("character varying(256)"); b.Property("PasswordHash") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("PhoneNumber") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("PhoneNumberConfirmed") - .HasColumnType("bit"); + .HasColumnType("boolean"); b.Property("SecurityStamp") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("TwoFactorEnabled") - .HasColumnType("bit"); + .HasColumnType("boolean"); b.Property("UserName") .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); + .HasColumnType("character varying(256)"); b.HasKey("Id"); @@ -78,8 +78,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.HasIndex("NormalizedUserName") .IsUnique() - .HasDatabaseName("UserNameIndex") - .HasFilter("[NormalizedUserName] IS NOT NULL"); + .HasDatabaseName("UserNameIndex"); b.ToTable("AspNetUsers"); }); @@ -88,17 +87,17 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("CarId") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("DateTime") - .HasColumnType("datetime2"); + .HasColumnType("timestamp without time zone"); b.Property("Status") - .HasColumnType("int"); + .HasColumnType("integer"); b.HasKey("Id"); @@ -111,59 +110,59 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("Button") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("CallTwiml") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("CarAdminPhone") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("CompanyName") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("Fuel") - .HasColumnType("float"); + .HasColumnType("double precision"); b.Property("HwId") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("Latitude") - .HasColumnType("float"); + .HasColumnType("double precision"); b.Property("Longitude") - .HasColumnType("float"); + .HasColumnType("double precision"); b.Property("Name") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("RouteId") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("SessionId") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("SessionLogged") - .HasColumnType("datetime2"); + .HasColumnType("timestamp without time zone"); b.Property("Speed") - .HasColumnType("float"); + .HasColumnType("double precision"); b.Property("Status") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("TenantId") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("Token") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("UnderTest") - .HasColumnType("bit"); + .HasColumnType("boolean"); b.HasKey("Id"); @@ -178,20 +177,20 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("CarId") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("Latitude") - .HasColumnType("float"); + .HasColumnType("double precision"); b.Property("Longitude") - .HasColumnType("float"); + .HasColumnType("double precision"); b.Property("Time") - .HasColumnType("datetime2"); + .HasColumnType("timestamp without time zone"); b.HasKey("Id"); @@ -208,32 +207,32 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("Height") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("Image") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("MaxLatitude") - .HasColumnType("float"); + .HasColumnType("double precision"); b.Property("MaxLongitude") - .HasColumnType("float"); + .HasColumnType("double precision"); b.Property("MinLatitude") - .HasColumnType("float"); + .HasColumnType("double precision"); b.Property("MinLongitude") - .HasColumnType("float"); + .HasColumnType("double precision"); b.Property("TenantId") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("Width") - .HasColumnType("int"); + .HasColumnType("integer"); b.HasKey("Id"); @@ -246,44 +245,44 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("Arrive") - .HasColumnType("datetime2"); + .HasColumnType("timestamp without time zone"); b.Property("CarId") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("FromStationId") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("FromStationPhone") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("FromStationStatus") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("Priority") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("Status") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("TenantId") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("ToStationId") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("ToStationPhone") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("ToStationStatus") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("UserId") - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.HasKey("Id"); @@ -304,17 +303,17 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("Color") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("Name") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("TenantId") - .HasColumnType("int"); + .HasColumnType("integer"); b.HasKey("Id"); @@ -327,26 +326,26 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("Latitude") - .HasColumnType("float"); + .HasColumnType("double precision"); b.Property("Longitude") - .HasColumnType("float"); + .HasColumnType("double precision"); b.Property("Order") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("RouteId") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("StationId") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("TenantId") - .HasColumnType("int"); + .HasColumnType("integer"); b.HasKey("Id"); @@ -363,26 +362,26 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("ContactPhone") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("Deleted") - .HasColumnType("bit"); + .HasColumnType("boolean"); b.Property("Latitude") - .HasColumnType("float"); + .HasColumnType("double precision"); b.Property("Longitude") - .HasColumnType("float"); + .HasColumnType("double precision"); b.Property("Name") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("TenantId") - .HasColumnType("int"); + .HasColumnType("integer"); b.HasKey("Id"); @@ -395,17 +394,16 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("Name") - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.HasKey("Id"); b.HasIndex("Name") - .IsUnique() - .HasFilter("[Name] IS NOT NULL"); + .IsUnique(); b.ToTable("Tenants"); }); @@ -414,14 +412,14 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("TenantId") - .HasColumnType("int"); + .HasColumnType("integer"); b.Property("UserId") - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.HasKey("Id"); @@ -435,26 +433,25 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => { b.Property("Id") - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("Name") .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); + .HasColumnType("character varying(256)"); b.Property("NormalizedName") .HasMaxLength(256) - .HasColumnType("nvarchar(256)"); + .HasColumnType("character varying(256)"); b.HasKey("Id"); b.HasIndex("NormalizedName") .IsUnique() - .HasDatabaseName("RoleNameIndex") - .HasFilter("[NormalizedName] IS NOT NULL"); + .HasDatabaseName("RoleNameIndex"); b.ToTable("AspNetRoles"); }); @@ -463,18 +460,18 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("RoleId") .IsRequired() - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.HasKey("Id"); @@ -487,18 +484,18 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("int") - .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); + .HasColumnType("integer") + .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn); b.Property("ClaimType") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("ClaimValue") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("UserId") .IsRequired() - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.HasKey("Id"); @@ -511,18 +508,18 @@ protected override void BuildModel(ModelBuilder modelBuilder) { b.Property("LoginProvider") .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); + .HasColumnType("character varying(128)"); b.Property("ProviderKey") .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); + .HasColumnType("character varying(128)"); b.Property("ProviderDisplayName") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.Property("UserId") .IsRequired() - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.HasKey("LoginProvider", "ProviderKey"); @@ -534,10 +531,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => { b.Property("UserId") - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.Property("RoleId") - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.HasKey("UserId", "RoleId"); @@ -549,18 +546,18 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { b.Property("UserId") - .HasColumnType("nvarchar(450)"); + .HasColumnType("text"); b.Property("LoginProvider") .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); + .HasColumnType("character varying(128)"); b.Property("Name") .HasMaxLength(128) - .HasColumnType("nvarchar(128)"); + .HasColumnType("character varying(128)"); b.Property("Value") - .HasColumnType("nvarchar(max)"); + .HasColumnType("text"); b.HasKey("UserId", "LoginProvider", "Name"); diff --git a/BE/Artin.BringAuto.MQTT/Artin.BringAuto.MQTT.Api.csproj b/BE/Artin.BringAuto.MQTT/Artin.BringAuto.MQTT.Api.csproj index e484411..f6ccc7f 100644 --- a/BE/Artin.BringAuto.MQTT/Artin.BringAuto.MQTT.Api.csproj +++ b/BE/Artin.BringAuto.MQTT/Artin.BringAuto.MQTT.Api.csproj @@ -8,6 +8,7 @@ + all diff --git a/BE/Artin.BringAuto.MQTT/Properties/launchSettings.json b/BE/Artin.BringAuto.MQTT/Properties/launchSettings.json new file mode 100644 index 0000000..258ff20 --- /dev/null +++ b/BE/Artin.BringAuto.MQTT/Properties/launchSettings.json @@ -0,0 +1,12 @@ +{ + "profiles": { + "Artin.BringAuto.MQTT.Api": { + "commandName": "Project", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:52328;http://localhost:52331" + } + } +} \ No newline at end of file diff --git a/BE/Artin.BringAuto.MQTTClient/Artin.BringAuto.MQTTClient.csproj b/BE/Artin.BringAuto.MQTTClient/Artin.BringAuto.MQTTClient.csproj index a798584..c9b9576 100644 --- a/BE/Artin.BringAuto.MQTTClient/Artin.BringAuto.MQTTClient.csproj +++ b/BE/Artin.BringAuto.MQTTClient/Artin.BringAuto.MQTTClient.csproj @@ -5,6 +5,7 @@ + diff --git a/BE/Artin.BringAuto.Mappings/Artin.BringAuto.Mappings.csproj b/BE/Artin.BringAuto.Mappings/Artin.BringAuto.Mappings.csproj index 3dc0f0b..250bb55 100644 --- a/BE/Artin.BringAuto.Mappings/Artin.BringAuto.Mappings.csproj +++ b/BE/Artin.BringAuto.Mappings/Artin.BringAuto.Mappings.csproj @@ -6,6 +6,7 @@ + diff --git a/BE/Artin.BringAuto.Shared/Artin.BringAuto.Shared.csproj b/BE/Artin.BringAuto.Shared/Artin.BringAuto.Shared.csproj index 9677a73..c3e9cdc 100644 --- a/BE/Artin.BringAuto.Shared/Artin.BringAuto.Shared.csproj +++ b/BE/Artin.BringAuto.Shared/Artin.BringAuto.Shared.csproj @@ -5,6 +5,7 @@ + diff --git a/BE/Artin.BringAuto.Test/Helpers/DtoDbHelpers/DtoDbHelpers.cs b/BE/Artin.BringAuto.Test/Helpers/DtoDbHelpers/DtoDbHelpers.cs new file mode 100644 index 0000000..1a169f0 --- /dev/null +++ b/BE/Artin.BringAuto.Test/Helpers/DtoDbHelpers/DtoDbHelpers.cs @@ -0,0 +1,39 @@ +using Movies.Api.Models; +using Movies.Data.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Movies.Api.Test.Helpers.DtoDbHelpers +{ + public static class DtoDbHelpers + { + public static Person DtoToDbPerson(PersonDto personDto) + { + Person person = new Person(); + personDto.Name = person.Name; + personDto.Country = person.Country; + personDto.Biography = person.Biography; + personDto.Role = person.Role; + personDto.Id = person.Id; + personDto.BirthDate = person.BirthDate; + + return person; + } + + public static PersonDto DbToDtoPerson(Person personDto) + { + PersonDto person = new PersonDto(); + personDto.Name = person.Name; + personDto.Country = person.Country; + personDto.Biography = person.Biography; + personDto.Role = person.Role; + personDto.Id = person.Id; + personDto.BirthDate = person.BirthDate; + + return person; + } + } +} diff --git a/BE/Artin.BringAuto.Test/Helpers/Extensions/ServiceCollectionExtensions.cs b/BE/Artin.BringAuto.Test/Helpers/Extensions/ServiceCollectionExtensions.cs new file mode 100644 index 0000000..170141e --- /dev/null +++ b/BE/Artin.BringAuto.Test/Helpers/Extensions/ServiceCollectionExtensions.cs @@ -0,0 +1,65 @@ +using Microsoft.Data.Sqlite; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; +using WebApplication18; + +namespace Helpers.Extensions.Tests.Helpers.Extensions +{ + public static class ServiceCollectionExtensions + { + /// + /// Removes all registrations of and adds in . + /// + /// The type of service interface which needs to be placed. + /// The test or mock implementation of to add into . + /// + public static void SwapService(this IServiceCollection services, ServiceLifetime serviceLifetime) + where TImplementation : class, TService + { + if (services.Any(x => x.ServiceType == typeof(TService) && x.Lifetime == serviceLifetime)) + { + var serviceDescriptors = services.Where(x => x.ServiceType == typeof(TService) && x.Lifetime == serviceLifetime).ToList(); + foreach (var serviceDescriptor in serviceDescriptors) + { + services.Remove(serviceDescriptor); + } + } + + if (serviceLifetime == ServiceLifetime.Transient) + services.AddTransient(typeof(TService), typeof(TImplementation)); + + else if (serviceLifetime == ServiceLifetime.Scoped) + services.AddScoped(typeof(TService), typeof(TImplementation)); + + else if (serviceLifetime == ServiceLifetime.Singleton) + services.AddSingleton(typeof(TService), typeof(TImplementation)); + } + + public static void SwapSqLiteDbContext(this IServiceCollection services) + where TDbContext : DbContext + { + // Remove the app's ApplicationDbContext registration. + var descriptor = services.SingleOrDefault(d => d.ServiceType == typeof(DbContextOptions)); + if (descriptor != null) + { + services.Remove(descriptor); + } + + var connection = new SqliteConnection($"DataSource='file:memdb{Guid.NewGuid()}?mode=memory&cache=shared'"); + connection.Open(); + + // Add ApplicationDbContext using an in-memory database for testing. + + var app = Assembly.GetAssembly(typeof(Startup)); + services.AddDbContext(options => options.UseSqlite(connection).UseTriggers(( + triggerOptions => triggerOptions.AddAssemblyTriggers(app)))); + } + } +} diff --git a/BE/Artin.BringAuto.Test/Integration/Modules/People/Fixtures/PeopleFixture.cs b/BE/Artin.BringAuto.Test/Integration/Modules/People/Fixtures/PeopleFixture.cs new file mode 100644 index 0000000..c48935a --- /dev/null +++ b/BE/Artin.BringAuto.Test/Integration/Modules/People/Fixtures/PeopleFixture.cs @@ -0,0 +1,15 @@ +using Movies.Data.Enums; +using Movies.Data.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Movies.Api.Test.Integration.Modules.People.Fixtures +{ + public class PeopleFixture : TestFixture + { + + } +} diff --git a/BE/Artin.BringAuto.Test/Integration/Modules/People/PeopleControllerTests.cs b/BE/Artin.BringAuto.Test/Integration/Modules/People/PeopleControllerTests.cs new file mode 100644 index 0000000..75c6bbb --- /dev/null +++ b/BE/Artin.BringAuto.Test/Integration/Modules/People/PeopleControllerTests.cs @@ -0,0 +1,70 @@ +using AutoMapper; +using FluentAssertions; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Moq; +using Movies.Api.Controllers.Movies.Api.Controllers; +using Movies.Api.Interfaces; +using Movies.Api.Models; +using Movies.Api.Test.Helpers.DtoDbHelpers; +using Movies.Api.Test.Integration.Modules.People.Fixtures; +using Movies.Api.Test.Integration.Shared.Helpers; +using Movies.Data.Models; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Text; +using System.Threading.Tasks; +using Xunit; + +namespace Movies.Api.Test.Integration.Modules.People +{ + public class PeopleControllerTests + { + [Fact] + public void GetPersonsTest() + { + // arrange + var service = new Mock(); + + var persons = TestFixture.GetFakeDataPersons(); + List personsDto = new List(); + foreach(var person in persons) + { + PersonDto personDto = DtoDbHelpers.DbToDtoPerson(person); + personsDto.Add(personDto); + } + service.Setup(x => x.GetAllPeople()).Returns(personsDto); + + var controller = new PeopleController(service.Object); + + // Act + var results = controller.GetPeople(); + + var count = results.Count(); + + // Assert + count.Equals(26); + } + + [Fact] + public void GetPerson() + { + // arrange + var service = new Mock(); + + var persons = TestFixture.GetFakeDataPersons(); + var firstPerson = DtoDbHelpers.DbToDtoPerson(persons.First()); + service.Setup(x => x.GetPerson(1)).Returns(firstPerson); + + var controller = new PeopleController(service.Object); + + // act + var result = controller.GetPerson(1); + + //assert + result.Should().NotBeNull(); + } + } +} diff --git a/BE/Artin.BringAuto.Test/Integration/Shared/Helpers/RequestHelper.cs b/BE/Artin.BringAuto.Test/Integration/Shared/Helpers/RequestHelper.cs new file mode 100644 index 0000000..41b3eb7 --- /dev/null +++ b/BE/Artin.BringAuto.Test/Integration/Shared/Helpers/RequestHelper.cs @@ -0,0 +1,21 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text; +using System.Threading.Tasks; + +namespace Movies.Api.Test.Integration.Shared.Helpers +{ + public class RequestHelper + { + public static StringContent MakeApiRequest(object content) + { + var request = new StringContent(JsonConvert.SerializeObject(content)); + request.Headers.ContentType = new MediaTypeHeaderValue("application/vnd.api+json"); + return request; + } + } +} diff --git a/BE/Artin.BringAuto.Test/Integration/TestFixture.cs b/BE/Artin.BringAuto.Test/Integration/TestFixture.cs new file mode 100644 index 0000000..7f0705d --- /dev/null +++ b/BE/Artin.BringAuto.Test/Integration/TestFixture.cs @@ -0,0 +1,103 @@ +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Mvc.Testing; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Hosting; +using Microsoft.AspNetCore.TestHost; +//using JsonApiDotNetCore.Repositories; +using Movies.Data.Data; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using System.Text; +using System.Threading.Tasks; +using WebApplication18; +using Helpers.Extensions.Tests.Helpers.Extensions; +using Movies.Data.Models; +using Moq; +using GenFu; + +namespace Movies.Api.Test.Integration +{ + public class TestFixture : IDisposable + { + private readonly IServiceProvider ServiceProvider; + + public HttpClient HttpClient { get; set; } + public IMock DbContext { get; private set; } + + public TestFixture() + { + var hostBuilder = new HostBuilder() + .ConfigureWebHost(webHost => + { + // Add TestServer + webHost.UseTestServer() + .UseStartup() + .UseEnvironment(Environments.Development) + .UseConfiguration(new ConfigurationBuilder() + .AddJsonFile("appsettings.Development.json") + .Build() + ); + + // configure the services after the startup has been called. + webHost.ConfigureTestServices(services => + { + // register the test one specifically + //services.SwapService(ServiceLifetime.Scoped); + services.SwapSqLiteDbContext(); + SetServices(services); + }); + }); + + var host = hostBuilder.Start(); + ServiceProvider = host.Services; + HttpClient = host.GetTestClient(); + DbContext = CreateDbContext(); + } + + public static IEnumerable GetFakeDataPersons() + { + var i = 1; + var persons = A.ListOf(26); + persons.ForEach(x => x.Id = i++); + return persons.Select(_ => _); + } + + private static IEnumerable GetFakeDataGenres() + { + var i = 1; + var genres = A.ListOf(26); + genres.ForEach(x => x.Id = i++); + return genres.Select(_ => _); + } + private static Mock CreateDbContext() + { + var persons = GetFakeDataPersons().AsQueryable(); + + var dbSet = new Mock>(); + dbSet.As>().Setup(m => m.Provider).Returns(persons.Provider); + dbSet.As>().Setup(m => m.Expression).Returns(persons.Expression); + dbSet.As>().Setup(m => m.ElementType).Returns(persons.ElementType); + dbSet.As>().Setup(m => m.GetEnumerator()).Returns(persons.GetEnumerator()); + + var context = new Mock(); + context.Setup(c => c.Persons).Returns(dbSet.Object); + return context; + } + public void ReloadContext() + => DbContext = new Mock(GetService>()); + + public T GetService() + => (T)ServiceProvider.GetService(typeof(T)); + + protected virtual void SetServices(IServiceCollection serviceCollection) { } + + public void Dispose() + { + HttpClient.Dispose(); + } + } +} diff --git a/BE/Artin.BringAuto.Test/Movies.Api.Test.csproj b/BE/Artin.BringAuto.Test/Movies.Api.Test.csproj new file mode 100644 index 0000000..5e43592 --- /dev/null +++ b/BE/Artin.BringAuto.Test/Movies.Api.Test.csproj @@ -0,0 +1,42 @@ + + + + net6.0 + + false + + + + + + + + + + + + + + + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + + + + + + diff --git a/BE/Artin.BringAuto/Artin.BringAuto.csproj b/BE/Artin.BringAuto/Artin.BringAuto.csproj index 5509cc2..8042859 100644 --- a/BE/Artin.BringAuto/Artin.BringAuto.csproj +++ b/BE/Artin.BringAuto/Artin.BringAuto.csproj @@ -9,6 +9,7 @@ + diff --git a/BE/Artin.BringAuto/Artin.BringAuto.csproj.user b/BE/Artin.BringAuto/Artin.BringAuto.csproj.user index 24b5cef..70f501a 100644 --- a/BE/Artin.BringAuto/Artin.BringAuto.csproj.user +++ b/BE/Artin.BringAuto/Artin.BringAuto.csproj.user @@ -4,7 +4,7 @@ ProjectDebugger - Artin.BringAuto + IIS Express Bring_Azure false diff --git a/BE/Artin.BringAuto/Repositories/CarRepository.cs b/BE/Artin.BringAuto/Repositories/CarRepository.cs index 4a18f95..5915e2a 100644 --- a/BE/Artin.BringAuto/Repositories/CarRepository.cs +++ b/BE/Artin.BringAuto/Repositories/CarRepository.cs @@ -55,8 +55,10 @@ public async Task SetSessionId(string companyName, string carName, string sessio } public Task IsKnownCar(string companyName, string carName) - => dbContext.Cars.IgnoreQueryFilters().AnyAsync(x => EF.Functions.Collate(x.CompanyName, "SQL_Latin1_General_CP1_CS_AS") == companyName - && EF.Functions.Collate(x.Name, "SQL_Latin1_General_CP1_CS_AS") == carName); + /*=> dbContext.Cars.IgnoreQueryFilters().AnyAsync(x => EF.Functions.Collate(x.CompanyName, "SQL_Latin1_General_CP1_CS_AS") == companyName + && EF.Functions.Collate(x.Name, "SQL_Latin1_General_CP1_CS_AS") == carName);*/ + => dbContext.Cars.IgnoreQueryFilters().AnyAsync(x => x.CompanyName == companyName + && x.Name == carName); public async Task NormalizeButtonAsync(int timeoutSec) { diff --git a/BE/Artin.BringAuto/Startup.cs b/BE/Artin.BringAuto/Startup.cs index 7167a1d..aa06bc2 100644 --- a/BE/Artin.BringAuto/Startup.cs +++ b/BE/Artin.BringAuto/Startup.cs @@ -67,8 +67,8 @@ public void ConfigureServices(IServiceCollection services) services.AddDbContext(opt => { - opt.UseSqlServer(Configuration.GetValue("ConnectionStrings:BringAuto")); - //opt.UseNpgsql(Configuration.GetValue("ConnectionStrings:BringAuto")); + //opt.UseSqlServer(Configuration.GetValue("ConnectionStrings:BringAuto")); + opt.UseNpgsql(Configuration.GetValue("ConnectionStrings:PostgresConnection")); opt.EnableSensitiveDataLogging(); }, ServiceLifetime.Transient); services.AddAutoMapper(typeof(Artin.BringAuto.Mappings.CarMap).Assembly); @@ -188,11 +188,13 @@ public void ConfigureServices(IServiceCollection services) services.AddSpaStaticFiles(opt => { opt.RootPath = "App"; }); services.AddMqtt(Configuration); + AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); } // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IWebHostEnvironment env) { + AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); using (var scope = app.ApplicationServices.GetService().CreateScope()) { var ctx = scope.ServiceProvider.GetRequiredService(); diff --git a/BE/Artin.BringAuto/appsettings.Development.json b/BE/Artin.BringAuto/appsettings.Development.json index 95ab6f6..bbc42b0 100644 --- a/BE/Artin.BringAuto/appsettings.Development.json +++ b/BE/Artin.BringAuto/appsettings.Development.json @@ -19,7 +19,8 @@ ] }, "ConnectionStrings": { - "BringAuto": "Server=127.0.0.1,8433;Initial Catalog=bring_auto;Persist Security Info=False;User ID=sa;Password=ArtinTheBest2021!;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=True;Connection Timeout=30;" + "BringAuto": "Server=127.0.0.1,8433;Initial Catalog=bring_auto;Persist Security Info=False;User ID=sa;Password=ArtinTheBest2021!;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=True;Connection Timeout=30;", + "PostgresConnection": "Host=localhost;Database=postgres;Username=postgres; Password=Mordorov09" }, "MqttConfig": { "Enable": true, diff --git a/BE/BringAuto.Industrial.sln b/BE/BringAuto.Industrial.sln index 3d4a506..c28c8f7 100644 --- a/BE/BringAuto.Industrial.sln +++ b/BE/BringAuto.Industrial.sln @@ -21,7 +21,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Artin.BringAuto.MQTTClient" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Artin.BringAuto.MQTT.Api", "Artin.BringAuto.MQTT\Artin.BringAuto.MQTT.Api.csproj", "{0A1F2D30-7270-42D2-8D53-DFC226F46621}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Artin.BringAuto.Test", "Test\Artin.BringAuto.Test.csproj", "{76DA92F9-2CD9-454A-9C38-C88355A5043D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Artin.BringAuto.Test", "Test\Artin.BringAuto.Test.csproj", "{76DA92F9-2CD9-454A-9C38-C88355A5043D}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/BE/Test/Artin.BringAuto.Test.csproj b/BE/Test/Artin.BringAuto.Test.csproj index 0ef87cd..4906ffc 100644 --- a/BE/Test/Artin.BringAuto.Test.csproj +++ b/BE/Test/Artin.BringAuto.Test.csproj @@ -1,4 +1,4 @@ - + net6.0 @@ -9,7 +9,17 @@ + + + + + + + + + + runtime; build; native; contentfiles; analyzers; buildtransitive @@ -22,6 +32,11 @@ + + + + + diff --git a/BE/Test/Cars/Integrations/Cars/CarRepositoryTest.cs b/BE/Test/Cars/Integrations/Cars/CarRepositoryTest.cs deleted file mode 100644 index c628fb5..0000000 --- a/BE/Test/Cars/Integrations/Cars/CarRepositoryTest.cs +++ /dev/null @@ -1,31 +0,0 @@ -using Artin.BringAuto.DAL.Models; -using Artin.BringAuto.Test.Cars.Integrations.Fixtures; -using BringAuto.Server.Repositories; -using Microsoft.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Artin.BringAuto.Test.Cars.Integrations.Cars -{ - public class CarControllerTest : IClassFixture - { - private readonly CarFixture _fixture; - private readonly DbSet _entities; - private const string _modelRoute = "api/v1/cars"; - - public CarControllerTest(CarFixture fixture) - { - _fixture = fixture; - _entities = _fixture.DbContext.Set(); - } - - [Fact] - public void IsKnownCar_Not_Undertest_Test() - { - - } - } -} diff --git a/BE/Test/Cars/Integrations/Cars/CarsControllerTest.cs b/BE/Test/Cars/Integrations/Cars/CarsControllerTest.cs new file mode 100644 index 0000000..4fdda5d --- /dev/null +++ b/BE/Test/Cars/Integrations/Cars/CarsControllerTest.cs @@ -0,0 +1,41 @@ +using Artin.BringAuto.DAL; +using Artin.BringAuto.DAL.Models; +using Artin.BringAuto.GraphQL.Cars; +using Artin.BringAuto.Shared.Cars; +using AutoMapper; +using BringAuto.Server.Repositories; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using Moq; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Artin.BringAuto.Test.Cars.Integrations.Cars +{ + public class CarsControllerTests + { + [Fact] + public void GetCarsTest() + { + // arrange + + var items = TestFixture.GetFakeDataCars(); + IMapper mapper = null; + + var service = new CarRepository(null, null, null, null); + + var controller = new CarQuery(service); + + // Act + var results = controller.GetCars(); + + var count = results.Count(); + + // Assert + count.Equals(26); + } + } +} diff --git a/BE/Test/Cars/Integrations/Fixtures/CarFixture.cs b/BE/Test/Cars/Integrations/Fixtures/CarFixture.cs deleted file mode 100644 index 6ebd15c..0000000 --- a/BE/Test/Cars/Integrations/Fixtures/CarFixture.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Artin.BringAuto.Test.Cars.Integrations.Fixtures -{ - public class CarFixture : TestFixture - { - - } -} diff --git a/BE/Test/Cars/Units/Cars/CarRepository.cs b/BE/Test/Cars/Units/Cars/CarRepository.cs new file mode 100644 index 0000000..ef79511 --- /dev/null +++ b/BE/Test/Cars/Units/Cars/CarRepository.cs @@ -0,0 +1,25 @@ +using FluentAssertions; +using Microsoft.EntityFrameworkCore; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Xml.Linq; + +namespace Artin.BringAuto.Test.Cars.Units.Cars +{ + public class CarRepository + { + [Theory] + [InlineData("octavia", "octavia")] + public static void IsKnownCar_CarName(string carNameDb, string carName) + { + //toto se delat nesmi, test spadne protoze lze testovat jen na realne databazi! + //https://stackoverflow.com/questions/70693625/the-collate-method-is-not-supported-because-the-query-has-switched-to-client-e + var efName = EF.Functions.Collate(carNameDb, "SQL_Latin1_General_CP1_CS_AS"); + //efName.Should().NotBeNullOrWhiteSpace(); + carName.Should().Be(efName); + } + } +} diff --git a/BE/Test/Helpers/Extensions/ServiceCollectionExtensions.cs b/BE/Test/Helpers/Extensions/ServiceCollectionExtensions.cs new file mode 100644 index 0000000..66684ea --- /dev/null +++ b/BE/Test/Helpers/Extensions/ServiceCollectionExtensions.cs @@ -0,0 +1,65 @@ +using Artin.BringAuto; +using Microsoft.Data.Sqlite; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using System; +using System.Collections.Generic; +using System.Data.SqlClient; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace Helpers.Extensions.Tests.Helpers.Extensions +{ + public static class ServiceCollectionExtensions + { + /// + /// Removes all registrations of and adds in . + /// + /// The type of service interface which needs to be placed. + /// The test or mock implementation of to add into . + /// + public static void SwapService(this IServiceCollection services, ServiceLifetime serviceLifetime) + where TImplementation : class, TService + { + if (services.Any(x => x.ServiceType == typeof(TService) && x.Lifetime == serviceLifetime)) + { + var serviceDescriptors = services.Where(x => x.ServiceType == typeof(TService) && x.Lifetime == serviceLifetime).ToList(); + foreach (var serviceDescriptor in serviceDescriptors) + { + services.Remove(serviceDescriptor); + } + } + + if (serviceLifetime == ServiceLifetime.Transient) + services.AddTransient(typeof(TService), typeof(TImplementation)); + + else if (serviceLifetime == ServiceLifetime.Scoped) + services.AddScoped(typeof(TService), typeof(TImplementation)); + + else if (serviceLifetime == ServiceLifetime.Singleton) + services.AddSingleton(typeof(TService), typeof(TImplementation)); + } + + public static void SwapSqLiteDbContext(this IServiceCollection services) + where TDbContext : DbContext + { + // Remove the app's ApplicationDbContext registration. + var descriptor = services.SingleOrDefault(d => d.ServiceType == typeof(DbContextOptions)); + if (descriptor != null) + { + services.Remove(descriptor); + } + + var connection = new SqliteConnection($"DataSource='file:memdb{Guid.NewGuid()}?mode=memory&cache=shared'"); + connection.Open(); + + // Add ApplicationDbContext using an in-memory database for testing. + + var app = Assembly.GetAssembly(typeof(Startup)); + IServiceCollection serviceCollection = services.AddDbContext(/*options => options.UseSqlite(connection).UseTriggers(( + triggerOptions => triggerOptions.AddAssemblyTriggers(app)))*/); + } + } +} diff --git a/BE/Test/TestFixture.cs b/BE/Test/TestFixture.cs index cf22659..c51dd2a 100644 --- a/BE/Test/TestFixture.cs +++ b/BE/Test/TestFixture.cs @@ -1,25 +1,25 @@ using Artin.BringAuto.DAL; +using Artin.BringAuto.DAL.Models; + +using GenFu; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using Microsoft.AspNetCore.Hosting; +using Moq; +using Microsoft.AspNetCore.TestHost; +using Helpers.Extensions.Tests.Helpers.Extensions; namespace Artin.BringAuto.Test { public class TestFixture : IDisposable { - public const string USERNAME = "j.hodic@fingood.cz"; - public const string PASSWORD = "Abc123456789"; - private readonly IServiceProvider _services; + private readonly IServiceProvider ServiceProvider; public HttpClient HttpClient { get; set; } - public BringAutoDbContext DbContext { get; private set; } - /* + public IMock DbContext { get; private set; } + public TestFixture() { var hostBuilder = new HostBuilder() @@ -38,53 +38,51 @@ public TestFixture() webHost.ConfigureTestServices(services => { // register the test one specifically - + //services.SwapService(ServiceLifetime.Scoped); services.SwapSqLiteDbContext(); SetServices(services); }); }); var host = hostBuilder.Start(); - _services = host.Services; + ServiceProvider = host.Services; HttpClient = host.GetTestClient(); - DbContext = GetService().GetContext() as BringAutoDbContext; + DbContext = CreateDbContext(); + } + + public static IEnumerable GetFakeDataCars() + { + var i = 1; + var persons = A.ListOf(26); + persons.ForEach(x => x.Id = i++); + return persons.Select(_ => _); + } - // Init DB - CreateDatabase(); + private static Mock CreateDbContext() + { + var cars = GetFakeDataCars().AsQueryable(); + var dbSet = new Mock>(); + dbSet.As>().Setup(m => m.Provider).Returns(cars.Provider); + dbSet.As>().Setup(m => m.Expression).Returns(cars.Expression); + dbSet.As>().Setup(m => m.ElementType).Returns(cars.ElementType); + dbSet.As>().Setup(m => m.GetEnumerator()).Returns(cars.GetEnumerator()); + var context = new Mock(); + context.Setup(c => c.Cars).Returns(dbSet.Object); + return context; } - public void ReloadContext() - { - DbContext = new BringAutoDbContext(GetService>()); - } + => DbContext = new Mock(GetService>()); - */ - public virtual void CreateDatabase() - => DbContext.Database.EnsureCreated(); - - public IServiceProvider GetServices() => _services; - public T GetService() => (T)_services.GetService(typeof(T)); + public T GetService() + => (T)ServiceProvider.GetService(typeof(T)); protected virtual void SetServices(IServiceCollection serviceCollection) { } public void Dispose() { - Dispose(true); - GC.SuppressFinalize(this); - } - - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - if (HttpClient != null) - { - HttpClient.Dispose(); - HttpClient = null; - } - } + HttpClient.Dispose(); } } diff --git a/BE/Test/UnitTest1.cs b/BE/Test/UnitTest1.cs deleted file mode 100644 index 499e281..0000000 --- a/BE/Test/UnitTest1.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Artin.Bringauto.Test -{ - public class UnitTest1 - { - [Fact] - public void Test1() - { - - } - } -} \ No newline at end of file