Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
gitignore fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SrdjanStankov committed Jul 27, 2020
1 parent 1f7c599 commit 2fe0a7f
Show file tree
Hide file tree
Showing 9 changed files with 533 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -396,3 +396,4 @@ yarn-error.log

.notes.md
baseline.json
/PUSGS_Project/Core/Core.csproj.user
10 changes: 10 additions & 0 deletions PUSGS_Project/Persistance.User/Configurations/UserConfiguration.cs
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);
}
}

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

77 changes: 77 additions & 0 deletions PUSGS_Project/Persistance.User/Migrations/20200726214357_Init.cs
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");
}
}
}
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
}
}
}
25 changes: 25 additions & 0 deletions PUSGS_Project/Persistance.User/Persistance.User.csproj
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>
Loading

0 comments on commit 2fe0a7f

Please sign in to comment.