mama say mama sa mama coo sa

This commit is contained in:
dasha 2023-04-08 17:24:05 +04:00
parent a48d6d1e44
commit a6aa2d3e35
4 changed files with 12 additions and 23 deletions

View File

@ -10,7 +10,7 @@ namespace HardwareShopDatabaseImplement
{ {
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{ {
optionsBuilder.UseNpgsql("Host=localhost;Port=5432;Database=Computer_Hardware_Store3;Username=postgres;Password=1234"); optionsBuilder.UseNpgsql("Host=localhost;Port=5433;Database=Computer_Hardware_Store;Username=user;Password=12345");
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
} }

View File

@ -12,8 +12,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace HardwareShopDatabaseImplement.Migrations namespace HardwareShopDatabaseImplement.Migrations
{ {
[DbContext(typeof(HardwareShopDatabase))] [DbContext(typeof(HardwareShopDatabase))]
[Migration("20230408110229_Init")] [Migration("20230408132346_mama-say-mama-sa-mama-coo-sa")]
partial class Init partial class mamasaymamasamamacoosa
{ {
/// <inheritdoc /> /// <inheritdoc />
protected override void BuildTargetModel(ModelBuilder modelBuilder) protected override void BuildTargetModel(ModelBuilder modelBuilder)
@ -414,13 +414,11 @@ namespace HardwareShopDatabaseImplement.Migrations
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Worker.Build", b => modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Worker.Build", b =>
{ {
b.HasOne("HardwareShopDatabaseImplement.Models.User", "User") b.HasOne("HardwareShopDatabaseImplement.Models.User", null)
.WithMany("Builds") .WithMany("Builds")
.HasForeignKey("UserId") .HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("User");
}); });
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Worker.Comment", b => modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Worker.Comment", b =>
@ -431,26 +429,22 @@ namespace HardwareShopDatabaseImplement.Migrations
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.HasOne("HardwareShopDatabaseImplement.Models.User", "User") b.HasOne("HardwareShopDatabaseImplement.Models.User", null)
.WithMany("Comments") .WithMany("Comments")
.HasForeignKey("UserId") .HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("Build"); b.Navigation("Build");
b.Navigation("User");
}); });
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Worker.Purchase", b => modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Worker.Purchase", b =>
{ {
b.HasOne("HardwareShopDatabaseImplement.Models.User", "User") b.HasOne("HardwareShopDatabaseImplement.Models.User", null)
.WithMany("Purchases") .WithMany("Purchases")
.HasForeignKey("UserId") .HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("User");
}); });
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Storekeeper.Component", b => modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Storekeeper.Component", b =>

View File

@ -1,4 +1,5 @@
using Microsoft.EntityFrameworkCore.Migrations; using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable #nullable disable
@ -6,7 +7,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace HardwareShopDatabaseImplement.Migrations namespace HardwareShopDatabaseImplement.Migrations
{ {
/// <inheritdoc /> /// <inheritdoc />
public partial class Init : Migration public partial class mamasaymamasamamacoosa : Migration
{ {
/// <inheritdoc /> /// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder) protected override void Up(MigrationBuilder migrationBuilder)

View File

@ -411,13 +411,11 @@ namespace HardwareShopDatabaseImplement.Migrations
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Worker.Build", b => modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Worker.Build", b =>
{ {
b.HasOne("HardwareShopDatabaseImplement.Models.User", "User") b.HasOne("HardwareShopDatabaseImplement.Models.User", null)
.WithMany("Builds") .WithMany("Builds")
.HasForeignKey("UserId") .HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("User");
}); });
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Worker.Comment", b => modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Worker.Comment", b =>
@ -428,26 +426,22 @@ namespace HardwareShopDatabaseImplement.Migrations
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.HasOne("HardwareShopDatabaseImplement.Models.User", "User") b.HasOne("HardwareShopDatabaseImplement.Models.User", null)
.WithMany("Comments") .WithMany("Comments")
.HasForeignKey("UserId") .HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("Build"); b.Navigation("Build");
b.Navigation("User");
}); });
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Worker.Purchase", b => modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Worker.Purchase", b =>
{ {
b.HasOne("HardwareShopDatabaseImplement.Models.User", "User") b.HasOne("HardwareShopDatabaseImplement.Models.User", null)
.WithMany("Purchases") .WithMany("Purchases")
.HasForeignKey("UserId") .HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade) .OnDelete(DeleteBehavior.Cascade)
.IsRequired(); .IsRequired();
b.Navigation("User");
}); });
modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Storekeeper.Component", b => modelBuilder.Entity("HardwareShopDatabaseImplement.Models.Storekeeper.Component", b =>