Skip to content

Commit

Permalink
lots of changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ibrohim-qosimov committed Sep 16, 2024
1 parent 67c0415 commit 45d1d49
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 968 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
414 changes: 0 additions & 414 deletions UrphaCapital.Infrastructure/Migrations/20240915071306_test.Designer.cs

This file was deleted.

This file was deleted.

50 changes: 0 additions & 50 deletions UrphaCapital.Infrastructure/Migrations/20240916182727_toaster.cs

This file was deleted.

75 changes: 0 additions & 75 deletions UrphaCapital.Infrastructure/Migrations/20240916190519_usus.cs

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
Email = table.Column<string>(type: "text", nullable: false),
PasswordHash = table.Column<string>(type: "text", nullable: false),
Salt = table.Column<string>(type: "text", nullable: false),
CourseIds = table.Column<List<string>>(type: "text[]", nullable: false),
CourseIds = table.Column<List<Guid>>(type: "uuid[]", nullable: true),
Role = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
Expand Down Expand Up @@ -131,6 +131,34 @@ protected override void Up(MigrationBuilder migrationBuilder)
onDelete: ReferentialAction.Cascade);
});

migrationBuilder.CreateTable(
name: "Paymentss",
columns: table => new
{
Id = table.Column<long>(type: "bigint", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
StudentId = table.Column<long>(type: "bigint", nullable: false),
CourseId = table.Column<Guid>(type: "uuid", nullable: false),
Amount = table.Column<decimal>(type: "numeric", nullable: false),
PaymentStatus = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Paymentss", x => x.Id);
table.ForeignKey(
name: "FK_Paymentss_Courses_CourseId",
column: x => x.CourseId,
principalTable: "Courses",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Paymentss_Students_StudentId",
column: x => x.StudentId,
principalTable: "Students",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});

migrationBuilder.CreateTable(
name: "Homeworks",
columns: table => new
Expand Down Expand Up @@ -200,7 +228,7 @@ protected override void Up(MigrationBuilder migrationBuilder)
migrationBuilder.InsertData(
table: "Admins",
columns: new[] { "Id", "Email", "Name", "PasswordHash", "PhoneNumber", "Role", "Salt" },
values: new object[] { 1L, "admin@gmail.com", "Ozod Ali", "ic/h0fbizeHxmzCmNW6s5EDmZD80+w93Y11bQmvCFe8=", "+998934013443", "SuperAdmin", "21c9622c-5f95-449e-b5a0-e32e9a8fd3b1" });
values: new object[] { 1L, "admin@gmail.com", "Ozod Ali", "24dDXhFhsubK1TjpHYRVQ/leqv8xmcH0Fr8Q8Wn0rnM=", "+998934013443", "SuperAdmin", "101e6e94-0f83-4bf2-bea1-e40317770900" });

migrationBuilder.CreateIndex(
name: "IX_Answers_TestId",
Expand All @@ -222,6 +250,16 @@ protected override void Up(MigrationBuilder migrationBuilder)
table: "Lessons",
column: "CourseId");

migrationBuilder.CreateIndex(
name: "IX_Paymentss_CourseId",
table: "Paymentss",
column: "CourseId");

migrationBuilder.CreateIndex(
name: "IX_Paymentss_StudentId",
table: "Paymentss",
column: "StudentId");

migrationBuilder.CreateIndex(
name: "IX_Tests_LessonId",
table: "Tests",
Expand All @@ -244,11 +282,14 @@ protected override void Down(MigrationBuilder migrationBuilder)
name: "Homeworks");

migrationBuilder.DropTable(
name: "Students");
name: "Paymentss");

migrationBuilder.DropTable(
name: "Tests");

migrationBuilder.DropTable(
name: "Students");

migrationBuilder.DropTable(
name: "Lessons");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@ protected override void BuildModel(ModelBuilder modelBuilder)
Id = 1L,
Email = "admin@gmail.com",
Name = "Ozod Ali",
PasswordHash = "LXixSmGK1zCimS7HJigEQYR1MWACNvNMb9ARcmRusdU=",
PasswordHash = "24dDXhFhsubK1TjpHYRVQ/leqv8xmcH0Fr8Q8Wn0rnM=",
PhoneNumber = "+998934013443",
Role = "SuperAdmin",
Salt = "c8dc5061-7022-41ee-b2aa-d397f56b3fb3"
Salt = "101e6e94-0f83-4bf2-bea1-e40317770900"
});
});

Expand Down Expand Up @@ -154,8 +154,8 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.IsRequired()
.HasColumnType("text");
b.Property<List<string>>("CourseIds")
.HasColumnType("text[]");
b.Property<List<Guid>>("CourseIds")
.HasColumnType("uuid[]");
b.Property<string>("Email")
.IsRequired()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
Salt = salt
});

modelBuilder.Entity<Student>()
.Property(s => s.CourseIds)
.HasColumnType("uuid[]");

}

Expand Down

0 comments on commit 45d1d49

Please sign in to comment.