This repository has been archived by the owner on Apr 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1f7c599
commit 2fe0a7f
Showing
9 changed files
with
533 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -396,3 +396,4 @@ yarn-error.log | |
|
||
.notes.md | ||
baseline.json | ||
/PUSGS_Project/Core/Core.csproj.user |
10 changes: 10 additions & 0 deletions
10
PUSGS_Project/Persistance.User/Configurations/UserConfiguration.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
|
||
namespace Persistance.User.Configurations | ||
{ | ||
public class UserConfiguration : IEntityTypeConfiguration<Core.Entities.User> | ||
{ | ||
public void Configure(EntityTypeBuilder<Core.Entities.User> builder) => builder.HasKey(u => u.Email); | ||
} | ||
} |
101 changes: 101 additions & 0 deletions
101
PUSGS_Project/Persistance.User/Migrations/20200726214357_Init.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
77 changes: 77 additions & 0 deletions
77
PUSGS_Project/Persistance.User/Migrations/20200726214357_Init.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
namespace Persistance.User.Migrations | ||
{ | ||
public partial class Init : Migration | ||
{ | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.CreateTable( | ||
name: "Users", | ||
columns: table => new | ||
{ | ||
Email = table.Column<string>(nullable: false), | ||
City = table.Column<string>(nullable: true), | ||
LastName = table.Column<string>(nullable: true), | ||
Name = table.Column<string>(nullable: true), | ||
Password = table.Column<string>(nullable: true), | ||
Phone = table.Column<string>(nullable: true), | ||
IsVerified = table.Column<bool>(nullable: false), | ||
IsSystemAdmin = table.Column<bool>(nullable: false), | ||
IsRentACarAdmin = table.Column<bool>(nullable: false), | ||
IsAviationAdmin = table.Column<bool>(nullable: false), | ||
Points = table.Column<double>(nullable: false), | ||
RequirePasswordChange = table.Column<bool>(nullable: false) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_Users", x => x.Email); | ||
}); | ||
|
||
migrationBuilder.CreateTable( | ||
name: "UserFriends", | ||
columns: table => new | ||
{ | ||
Id = table.Column<long>(nullable: false) | ||
.Annotation("SqlServer:Identity", "1, 1"), | ||
FriendEmail = table.Column<string>(nullable: true), | ||
UserEmail = table.Column<string>(nullable: true) | ||
}, | ||
constraints: table => | ||
{ | ||
table.PrimaryKey("PK_UserFriends", x => x.Id); | ||
table.ForeignKey( | ||
name: "FK_UserFriends_Users_FriendEmail", | ||
column: x => x.FriendEmail, | ||
principalTable: "Users", | ||
principalColumn: "Email", | ||
onDelete: ReferentialAction.Restrict); | ||
table.ForeignKey( | ||
name: "FK_UserFriends_Users_UserEmail", | ||
column: x => x.UserEmail, | ||
principalTable: "Users", | ||
principalColumn: "Email", | ||
onDelete: ReferentialAction.Restrict); | ||
}); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_UserFriends_FriendEmail", | ||
table: "UserFriends", | ||
column: "FriendEmail"); | ||
|
||
migrationBuilder.CreateIndex( | ||
name: "IX_UserFriends_UserEmail", | ||
table: "UserFriends", | ||
column: "UserEmail"); | ||
} | ||
|
||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.DropTable( | ||
name: "UserFriends"); | ||
|
||
migrationBuilder.DropTable( | ||
name: "Users"); | ||
} | ||
} | ||
} |
99 changes: 99 additions & 0 deletions
99
PUSGS_Project/Persistance.User/Migrations/UserDbContextModelSnapshot.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
// <auto-generated /> | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Infrastructure; | ||
using Microsoft.EntityFrameworkCore.Metadata; | ||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion; | ||
using Persistance.User; | ||
|
||
namespace Persistance.User.Migrations | ||
{ | ||
[DbContext(typeof(UserDbContext))] | ||
partial class UserDbContextModelSnapshot : ModelSnapshot | ||
{ | ||
protected override void BuildModel(ModelBuilder modelBuilder) | ||
{ | ||
#pragma warning disable 612, 618 | ||
modelBuilder | ||
.HasAnnotation("ProductVersion", "3.1.6") | ||
.HasAnnotation("Relational:MaxIdentifierLength", 128) | ||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); | ||
|
||
modelBuilder.Entity("Core.Entities.User", b => | ||
{ | ||
b.Property<string>("Email") | ||
.HasColumnType("nvarchar(450)"); | ||
|
||
b.Property<string>("City") | ||
.HasColumnType("nvarchar(max)"); | ||
|
||
b.Property<bool>("IsAviationAdmin") | ||
.HasColumnType("bit"); | ||
|
||
b.Property<bool>("IsRentACarAdmin") | ||
.HasColumnType("bit"); | ||
|
||
b.Property<bool>("IsSystemAdmin") | ||
.HasColumnType("bit"); | ||
|
||
b.Property<bool>("IsVerified") | ||
.HasColumnType("bit"); | ||
|
||
b.Property<string>("LastName") | ||
.HasColumnType("nvarchar(max)"); | ||
|
||
b.Property<string>("Name") | ||
.HasColumnType("nvarchar(max)"); | ||
|
||
b.Property<string>("Password") | ||
.HasColumnType("nvarchar(max)"); | ||
|
||
b.Property<string>("Phone") | ||
.HasColumnType("nvarchar(max)"); | ||
|
||
b.Property<double>("Points") | ||
.HasColumnType("float"); | ||
|
||
b.Property<bool>("RequirePasswordChange") | ||
.HasColumnType("bit"); | ||
|
||
b.HasKey("Email"); | ||
|
||
b.ToTable("Users"); | ||
}); | ||
|
||
modelBuilder.Entity("Core.Entities.UserFriends", b => | ||
{ | ||
b.Property<long>("Id") | ||
.ValueGeneratedOnAdd() | ||
.HasColumnType("bigint") | ||
.HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn); | ||
|
||
b.Property<string>("FriendEmail") | ||
.HasColumnType("nvarchar(450)"); | ||
|
||
b.Property<string>("UserEmail") | ||
.HasColumnType("nvarchar(450)"); | ||
|
||
b.HasKey("Id"); | ||
|
||
b.HasIndex("FriendEmail"); | ||
|
||
b.HasIndex("UserEmail"); | ||
|
||
b.ToTable("UserFriends"); | ||
}); | ||
|
||
modelBuilder.Entity("Core.Entities.UserFriends", b => | ||
{ | ||
b.HasOne("Core.Entities.User", "Friend") | ||
.WithMany() | ||
.HasForeignKey("FriendEmail"); | ||
|
||
b.HasOne("Core.Entities.User", "User") | ||
.WithMany() | ||
.HasForeignKey("UserEmail"); | ||
}); | ||
#pragma warning restore 612, 618 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<TargetFramework>netcoreapp3.1</TargetFramework> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<Compile Remove="Migrations\20200726213958_InitialMigration.cs" /> | ||
<Compile Remove="Migrations\20200726213958_InitialMigration.Designer.cs" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="3.1.6" /> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.6" /> | ||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.6"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<ProjectReference Include="..\Core\Core.csproj" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Oops, something went wrong.