Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
ProjectsStatusManagement
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hasan.bahjat
ProjectsStatusManagement
Commits
1d47855f
Commit
1d47855f
authored
Aug 11, 2024
by
hasan khaddour
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Reports..
parent
29cc9621
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
1518 additions
and
7 deletions
+1518
-7
PSManagement.Domain.csproj
PSManagement.Domain/PSManagement.Domain.csproj
+0
-1
Report.cs
PSManagement.Domain/Reports/Entities/Report.cs
+45
-0
AppDbContext.cs
...Infrastructure.Persistence/AppDataContext/AppDbContext.cs
+3
-1
20240811203222_AddReports.Designer.cs
...sistence/Migrations/20240811203222_AddReports.Designer.cs
+1130
-0
20240811203222_AddReports.cs
...cture.Persistence/Migrations/20240811203222_AddReports.cs
+172
-0
AppDbContextModelSnapshot.cs
...cture.Persistence/Migrations/AppDbContextModelSnapshot.cs
+168
-5
No files found.
PSManagement.Domain/PSManagement.Domain.csproj
View file @
1d47855f
...
...
@@ -6,7 +6,6 @@
<ItemGroup>
<Folder Include="Identity\ValueObjects\" />
<Folder Include="Reports\Entities\" />
<Folder Include="Reports\Repositories\" />
</ItemGroup>
...
...
PSManagement.Domain/Reports/Entities/Report.cs
0 → 100644
View file @
1d47855f
using
PSManagement.SharedKernel.Entities
;
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
PSManagement.Domain.Reports.Entities
{
public
class
Report
:
BaseEntity
{
public
String
ReportName
{
get
;
set
;
}
public
ICollection
<
Section
>
Sections
{
get
;
set
;
}
}
public
class
Section
:
BaseEntity
{
public
String
SectionName
{
get
;
set
;
}
public
Report
Report
{
get
;
set
;
}
public
ICollection
<
Question
>
Questions
{
get
;
set
;
}
}
public
class
Question
:
BaseEntity
{
public
String
QuestionName
{
get
;
set
;
}
public
ICollection
<
Section
>
Sections
{
get
;
set
;
}
}
public
class
Answer
:
BaseEntity
{
public
Question
Question
{
get
;
set
;
}
public
String
AnswerValue
{
get
;
set
;
}
}
public
class
ReportResult
:
BaseEntity
{
public
Report
Report
{
get
;
set
;
}
public
ICollection
<
Answer
>
Answers
{
get
;
set
;
}
}
}
PSManagement.Infrastructure.Persistence/AppDataContext/AppDbContext.cs
View file @
1d47855f
...
...
@@ -3,6 +3,7 @@ using PSManagement.Domain.Customers.Entities;
using
PSManagement.Domain.Employees.Entities
;
using
PSManagement.Domain.Identity.Entities
;
using
PSManagement.Domain.Projects.Entities
;
using
PSManagement.Domain.Reports.Entities
;
using
PSManagement.Domain.Tracking
;
using
PSManagement.Domain.Tracking.Entities
;
using
PSManagement.Infrastructure.Persistence.SeedDataContext
;
...
...
@@ -17,7 +18,8 @@ namespace PSManagement.Infrastructure.Persistence
{
}
public
DbSet
<
Report
>
Reports
{
get
;
set
;
}
public
DbSet
<
ReportResult
>
ReportResults
{
get
;
set
;
}
public
DbSet
<
User
>
Users
{
get
;
set
;
}
public
DbSet
<
Role
>
Roles
{
get
;
set
;
}
public
DbSet
<
Permission
>
Permission
{
get
;
set
;
}
...
...
PSManagement.Infrastructure.Persistence/Migrations/20240811203222_AddReports.Designer.cs
0 → 100644
View file @
1d47855f
// <auto-generated />
using
System
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Infrastructure
;
using
Microsoft.EntityFrameworkCore.Metadata
;
using
Microsoft.EntityFrameworkCore.Migrations
;
using
Microsoft.EntityFrameworkCore.Storage.ValueConversion
;
using
PSManagement.Infrastructure.Persistence
;
namespace
PSManagement.Infrastructure.Persistence.Migrations
{
[
DbContext
(
typeof
(
AppDbContext
))]
[
Migration
(
"20240811203222_AddReports"
)]
partial
class
AddReports
{
protected
override
void
BuildTargetModel
(
ModelBuilder
modelBuilder
)
{
#pragma warning disable 612, 618
modelBuilder
.
HasAnnotation
(
"Relational:Collation"
,
"Arabic_CI_AS"
)
.
HasAnnotation
(
"Relational:MaxIdentifierLength"
,
128
)
.
HasAnnotation
(
"ProductVersion"
,
"5.0.17"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
modelBuilder
.
Entity
(
"PSManagement.Domain.Customers.Entities.Customer"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"CustomerName"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
string
>(
"Email"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Customers"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Employees.Entities.Department"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"Name"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Departments"
);
b
.
HasData
(
new
{
Id
=
1
,
Name
=
"قسم المعلوميات"
},
new
{
Id
=
2
,
Name
=
"قسم النظم الإلكترونيى"
},
new
{
Id
=
3
,
Name
=
"شؤون الطلاب"
});
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Employees.Entities.Employee"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
int
>(
"HIASTId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"UserId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"UserId"
)
.
IsUnique
();
b
.
ToTable
(
"Employees"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Identity.Entities.Permission"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"Name"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Permission"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Identity.Entities.Role"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"Name"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Roles"
);
b
.
HasData
(
new
{
Id
=
1
,
Name
=
"Admin"
},
new
{
Id
=
2
,
Name
=
"Employee"
},
new
{
Id
=
3
,
Name
=
"Scientific-Supervisor"
});
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Identity.Entities.User"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"Email"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
string
>(
"HashedPassword"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
string
>(
"UserName"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Users"
);
b
.
HasData
(
new
{
Id
=
2
,
Email
=
"Admin@Admin"
,
HashedPassword
=
"1234"
,
UserName
=
"Admin"
});
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Projects.Entities.Attachment"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"AttachmenDescription"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
string
>(
"AttachmentName"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
string
>(
"AttachmentUrl"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
int
?>(
"ProjectId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"ProjectId"
);
b
.
ToTable
(
"Attachment"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Projects.Entities.EmployeeParticipate"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
int
>(
"EmployeeId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"PartialTimeRatio"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"ProjectId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
string
>(
"Role"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"EmployeeId"
);
b
.
HasIndex
(
"ProjectId"
);
b
.
ToTable
(
"EmployeeParticipate"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Projects.Entities.FinancialSpending"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"CostType"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
string
>(
"Description"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
DateTime
>(
"ExpectedSpendingDate"
)
.
HasColumnType
(
"datetime2"
);
b
.
Property
<
int
>(
"LocalPurchase"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
?>(
"ProjectId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"ProjectId"
);
b
.
ToTable
(
"FinancialSpending"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Projects.Entities.Project"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
int
?>(
"CustomerId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"ExecuterId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"ProjectManagerId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
?>(
"ProjectStatusId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"ProposerId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"TeamLeaderId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"CustomerId"
);
b
.
HasIndex
(
"ExecuterId"
);
b
.
HasIndex
(
"ProjectManagerId"
);
b
.
HasIndex
(
"ProjectStatusId"
);
b
.
HasIndex
(
"ProposerId"
);
b
.
HasIndex
(
"TeamLeaderId"
);
b
.
ToTable
(
"Projects"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Projects.Entities.Step"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
int
>(
"CurrentCompletionRatio"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
string
>(
"Description"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
int
>(
"Duration"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"ProjectId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
DateTime
>(
"StartDate"
)
.
HasColumnType
(
"datetime2"
);
b
.
Property
<
string
>(
"StepName"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
int
>(
"Weight"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"ProjectId"
);
b
.
ToTable
(
"Steps"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.ProjectsStatus.Entites.ProjectStatus"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"Code"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
string
>(
"Details"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
string
>(
"Name"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"ProjectStatus"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.Answer"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"AnswerValue"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
int
?>(
"QuestionId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
?>(
"ReportResultId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"QuestionId"
);
b
.
HasIndex
(
"ReportResultId"
);
b
.
ToTable
(
"Answer"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.Question"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"QuestionName"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Question"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.Report"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"ReportName"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Reports"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.ReportResult"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
int
?>(
"ReportId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"ReportId"
);
b
.
ToTable
(
"ReportResults"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.Section"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
int
?>(
"ReportId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
string
>(
"SectionName"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"ReportId"
);
b
.
ToTable
(
"Section"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Tracking.EmployeeTrack"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"AssignedWork"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
int
>(
"EmloyeeId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
string
>(
"PerformedWork"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
int
>(
"TrackId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"WorkingHours"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"EmloyeeId"
);
b
.
HasIndex
(
"TrackId"
);
b
.
ToTable
(
"EmployeeTrack"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Tracking.Entities.StepTrack"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
int
>(
"ExecutionRatio"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"StepId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"TrackId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"StepId"
);
b
.
HasIndex
(
"TrackId"
);
b
.
ToTable
(
"StepTracks"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Tracking.Track"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
int
>(
"ProjectId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
DateTime
>(
"TrackDate"
)
.
HasColumnType
(
"datetime2"
);
b
.
Property
<
string
>(
"TrackNote"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"ProjectId"
);
b
.
ToTable
(
"Tracks"
);
});
modelBuilder
.
Entity
(
"PermissionRole"
,
b
=>
{
b
.
Property
<
int
>(
"PermissionsId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"RolesId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"PermissionsId"
,
"RolesId"
);
b
.
HasIndex
(
"RolesId"
);
b
.
ToTable
(
"PermissionRole"
);
});
modelBuilder
.
Entity
(
"QuestionSection"
,
b
=>
{
b
.
Property
<
int
>(
"QuestionsId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"SectionsId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"QuestionsId"
,
"SectionsId"
);
b
.
HasIndex
(
"SectionsId"
);
b
.
ToTable
(
"QuestionSection"
);
});
modelBuilder
.
Entity
(
"UserRole"
,
b
=>
{
b
.
Property
<
int
>(
"RoleId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"UserId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"RoleId"
,
"UserId"
);
b
.
HasIndex
(
"UserId"
);
b
.
ToTable
(
"UserRole"
);
b
.
HasData
(
new
{
RoleId
=
1
,
UserId
=
1
});
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Customers.Entities.Customer"
,
b
=>
{
b
.
OwnsMany
(
"PSManagement.Domain.Customers.Entities.ContactInfo"
,
"ContactInfo"
,
b1
=>
{
b1
.
Property
<
int
>(
"CustomerId"
)
.
HasColumnType
(
"int"
);
b1
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
string
>(
"ContactType"
)
.
HasColumnType
(
"nvarchar(max)"
);
b1
.
Property
<
string
>(
"ContactValue"
)
.
HasColumnType
(
"nvarchar(max)"
);
b1
.
HasKey
(
"CustomerId"
,
"Id"
);
b1
.
ToTable
(
"ContactInfo"
);
b1
.
WithOwner
()
.
HasForeignKey
(
"CustomerId"
);
});
b
.
OwnsOne
(
"PSManagement.Domain.Customers.ValueObjects.Address"
,
"Address"
,
b1
=>
{
b1
.
Property
<
int
>(
"CustomerId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
string
>(
"City"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"City"
);
b1
.
Property
<
string
>(
"StreetName"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"StreetName"
);
b1
.
Property
<
int
>(
"StreetNumber"
)
.
HasColumnType
(
"int"
)
.
HasColumnName
(
"StreetNumber"
);
b1
.
Property
<
int
>(
"ZipCode"
)
.
HasColumnType
(
"int"
)
.
HasColumnName
(
"ZipCode"
);
b1
.
HasKey
(
"CustomerId"
);
b1
.
ToTable
(
"Customers"
);
b1
.
WithOwner
()
.
HasForeignKey
(
"CustomerId"
);
});
b
.
Navigation
(
"Address"
);
b
.
Navigation
(
"ContactInfo"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Employees.Entities.Employee"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Identity.Entities.User"
,
"User"
)
.
WithOne
(
"Employee"
)
.
HasForeignKey
(
"PSManagement.Domain.Employees.Entities.Employee"
,
"UserId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
OwnsOne
(
"PSManagement.Domain.Employees.Entities.Availability"
,
"Availability"
,
b1
=>
{
b1
.
Property
<
int
>(
"EmployeeId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
int
>(
"CurrentWorkingHours"
)
.
HasColumnType
(
"int"
)
.
HasColumnName
(
"CurrentWorkingHours"
);
b1
.
Property
<
bool
>(
"IsAvailable"
)
.
HasColumnType
(
"bit"
)
.
HasColumnName
(
"IsAvailable"
);
b1
.
HasKey
(
"EmployeeId"
);
b1
.
ToTable
(
"Employees"
);
b1
.
WithOwner
()
.
HasForeignKey
(
"EmployeeId"
);
});
b
.
OwnsOne
(
"PSManagement.Domain.Employees.Entities.PersonalInfo"
,
"PersonalInfo"
,
b1
=>
{
b1
.
Property
<
int
>(
"EmployeeId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
string
>(
"FirstName"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"FirstName"
);
b1
.
Property
<
string
>(
"LastName"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"LastName"
);
b1
.
HasKey
(
"EmployeeId"
);
b1
.
ToTable
(
"Employees"
);
b1
.
WithOwner
()
.
HasForeignKey
(
"EmployeeId"
);
});
b
.
OwnsOne
(
"PSManagement.Domain.Employees.Entities.WorkInfo"
,
"WorkInfo"
,
b1
=>
{
b1
.
Property
<
int
>(
"EmployeeId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
string
>(
"WorkJob"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"WorkJob"
);
b1
.
Property
<
string
>(
"WorkType"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"WorkType"
);
b1
.
HasKey
(
"EmployeeId"
);
b1
.
ToTable
(
"Employees"
);
b1
.
WithOwner
()
.
HasForeignKey
(
"EmployeeId"
);
});
b
.
Navigation
(
"Availability"
);
b
.
Navigation
(
"PersonalInfo"
);
b
.
Navigation
(
"User"
);
b
.
Navigation
(
"WorkInfo"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Projects.Entities.Attachment"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Projects.Entities.Project"
,
null
)
.
WithMany
(
"Attachments"
)
.
HasForeignKey
(
"ProjectId"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Projects.Entities.EmployeeParticipate"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Employees.Entities.Employee"
,
"Employee"
)
.
WithMany
(
"EmployeeParticipates"
)
.
HasForeignKey
(
"EmployeeId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
HasOne
(
"PSManagement.Domain.Projects.Entities.Project"
,
"Project"
)
.
WithMany
(
"EmployeeParticipates"
)
.
HasForeignKey
(
"ProjectId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
Navigation
(
"Employee"
);
b
.
Navigation
(
"Project"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Projects.Entities.FinancialSpending"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Projects.Entities.Project"
,
null
)
.
WithMany
(
"FinancialSpending"
)
.
HasForeignKey
(
"ProjectId"
);
b
.
OwnsOne
(
"PSManagement.SharedKernel.ValueObjects.Money"
,
"ExternalPurchase"
,
b1
=>
{
b1
.
Property
<
int
>(
"FinancialSpendingId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
int
>(
"Ammount"
)
.
HasColumnType
(
"int"
)
.
HasColumnName
(
"ExternalPurchaseAmmount"
);
b1
.
Property
<
string
>(
"Currency"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"nvarchar(max)"
)
.
HasDefaultValue
(
"USD"
)
.
HasColumnName
(
"ExternalPurchaseCurrency"
);
b1
.
HasKey
(
"FinancialSpendingId"
);
b1
.
ToTable
(
"FinancialSpending"
);
b1
.
WithOwner
()
.
HasForeignKey
(
"FinancialSpendingId"
);
});
b
.
Navigation
(
"ExternalPurchase"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Projects.Entities.Project"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Customers.Entities.Customer"
,
null
)
.
WithMany
(
"Projects"
)
.
HasForeignKey
(
"CustomerId"
);
b
.
HasOne
(
"PSManagement.Domain.Employees.Entities.Department"
,
"Executer"
)
.
WithMany
()
.
HasForeignKey
(
"ExecuterId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
HasOne
(
"PSManagement.Domain.Employees.Entities.Employee"
,
"ProjectManager"
)
.
WithMany
()
.
HasForeignKey
(
"ProjectManagerId"
)
.
OnDelete
(
DeleteBehavior
.
Restrict
);
b
.
HasOne
(
"PSManagement.Domain.ProjectsStatus.Entites.ProjectStatus"
,
"ProjectStatus"
)
.
WithMany
()
.
HasForeignKey
(
"ProjectStatusId"
);
b
.
HasOne
(
"PSManagement.Domain.Customers.Entities.Customer"
,
"Proposer"
)
.
WithMany
()
.
HasForeignKey
(
"ProposerId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
HasOne
(
"PSManagement.Domain.Employees.Entities.Employee"
,
"TeamLeader"
)
.
WithMany
()
.
HasForeignKey
(
"TeamLeaderId"
)
.
OnDelete
(
DeleteBehavior
.
Restrict
);
b
.
OwnsOne
(
"PSManagement.Domain.Projects.ValueObjects.Aggreement"
,
"ProjectAggreement"
,
b1
=>
{
b1
.
Property
<
int
>(
"ProjectId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
DateTime
>(
"AggreementDate"
)
.
HasColumnType
(
"datetime2"
)
.
HasColumnName
(
"AggreementDate"
);
b1
.
Property
<
int
>(
"AggreementNumber"
)
.
HasColumnType
(
"int"
)
.
HasColumnName
(
"AggreementNumber"
);
b1
.
HasKey
(
"ProjectId"
);
b1
.
ToTable
(
"Projects"
);
b1
.
WithOwner
()
.
HasForeignKey
(
"ProjectId"
);
});
b
.
OwnsOne
(
"PSManagement.Domain.Projects.ValueObjects.FinancialFund"
,
"FinancialFund"
,
b1
=>
{
b1
.
Property
<
int
>(
"ProjectId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
string
>(
"FinancialStatus"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"FinicialStatus"
);
b1
.
Property
<
string
>(
"Source"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"FinicialSource"
);
b1
.
HasKey
(
"ProjectId"
);
b1
.
ToTable
(
"Projects"
);
b1
.
WithOwner
()
.
HasForeignKey
(
"ProjectId"
);
});
b
.
OwnsOne
(
"PSManagement.Domain.Projects.ValueObjects.ProjectInfo"
,
"ProjectInfo"
,
b1
=>
{
b1
.
Property
<
int
>(
"ProjectId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
string
>(
"Code"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"Code"
);
b1
.
Property
<
string
>(
"Description"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"Description"
);
b1
.
Property
<
DateTime
>(
"ExpectedEndDate"
)
.
HasColumnType
(
"datetime2"
)
.
HasColumnName
(
"ExpectedEndDate"
);
b1
.
Property
<
string
>(
"Name"
)
.
HasColumnType
(
"nvarchar(max)"
)
.
HasColumnName
(
"Name"
);
b1
.
Property
<
DateTime
>(
"StartDate"
)
.
HasColumnType
(
"datetime2"
)
.
HasColumnName
(
"StartDate"
);
b1
.
HasKey
(
"ProjectId"
);
b1
.
ToTable
(
"Projects"
);
b1
.
WithOwner
()
.
HasForeignKey
(
"ProjectId"
);
});
b
.
OwnsOne
(
"PSManagement.Domain.Projects.ValueObjects.ProposalInfo"
,
"ProposalInfo"
,
b1
=>
{
b1
.
Property
<
int
>(
"ProjectId"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b1
.
Property
<
DateTime
>(
"ProposingBookDate"
)
.
HasColumnType
(
"datetime2"
)
.
HasColumnName
(
"ProposingBookDate"
);
b1
.
Property
<
int
>(
"ProposingBookNumber"
)
.
HasColumnType
(
"int"
)
.
HasColumnName
(
"ProposingBookNumber"
);
b1
.
HasKey
(
"ProjectId"
);
b1
.
ToTable
(
"Projects"
);
b1
.
WithOwner
()
.
HasForeignKey
(
"ProjectId"
);
});
b
.
Navigation
(
"Executer"
);
b
.
Navigation
(
"FinancialFund"
);
b
.
Navigation
(
"ProjectAggreement"
);
b
.
Navigation
(
"ProjectInfo"
);
b
.
Navigation
(
"ProjectManager"
);
b
.
Navigation
(
"ProjectStatus"
);
b
.
Navigation
(
"ProposalInfo"
);
b
.
Navigation
(
"Proposer"
);
b
.
Navigation
(
"TeamLeader"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Projects.Entities.Step"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Projects.Entities.Project"
,
"Project"
)
.
WithMany
(
"Steps"
)
.
HasForeignKey
(
"ProjectId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
Navigation
(
"Project"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.Answer"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Reports.Entities.Question"
,
"Question"
)
.
WithMany
()
.
HasForeignKey
(
"QuestionId"
);
b
.
HasOne
(
"PSManagement.Domain.Reports.Entities.ReportResult"
,
null
)
.
WithMany
(
"Answers"
)
.
HasForeignKey
(
"ReportResultId"
);
b
.
Navigation
(
"Question"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.ReportResult"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Reports.Entities.Report"
,
"Report"
)
.
WithMany
()
.
HasForeignKey
(
"ReportId"
);
b
.
Navigation
(
"Report"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.Section"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Reports.Entities.Report"
,
"Report"
)
.
WithMany
(
"Sections"
)
.
HasForeignKey
(
"ReportId"
);
b
.
Navigation
(
"Report"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Tracking.EmployeeTrack"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Employees.Entities.Employee"
,
"Employee"
)
.
WithMany
(
"EmployeeTracks"
)
.
HasForeignKey
(
"EmloyeeId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
HasOne
(
"PSManagement.Domain.Tracking.Track"
,
"Track"
)
.
WithMany
(
"EmployeeTracks"
)
.
HasForeignKey
(
"TrackId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
Navigation
(
"Employee"
);
b
.
Navigation
(
"Track"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Tracking.Entities.StepTrack"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Projects.Entities.Step"
,
"Step"
)
.
WithMany
(
"StepTracks"
)
.
HasForeignKey
(
"StepId"
)
.
OnDelete
(
DeleteBehavior
.
Restrict
)
.
IsRequired
();
b
.
HasOne
(
"PSManagement.Domain.Tracking.Track"
,
"Track"
)
.
WithMany
(
"StepTracks"
)
.
HasForeignKey
(
"TrackId"
)
.
OnDelete
(
DeleteBehavior
.
Restrict
)
.
IsRequired
();
b
.
Navigation
(
"Step"
);
b
.
Navigation
(
"Track"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Tracking.Track"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Projects.Entities.Project"
,
"Project"
)
.
WithMany
(
"Tracks"
)
.
HasForeignKey
(
"ProjectId"
)
.
OnDelete
(
DeleteBehavior
.
Restrict
)
.
IsRequired
();
b
.
Navigation
(
"Project"
);
});
modelBuilder
.
Entity
(
"PermissionRole"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Identity.Entities.Permission"
,
null
)
.
WithMany
()
.
HasForeignKey
(
"PermissionsId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
HasOne
(
"PSManagement.Domain.Identity.Entities.Role"
,
null
)
.
WithMany
()
.
HasForeignKey
(
"RolesId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
});
modelBuilder
.
Entity
(
"QuestionSection"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Reports.Entities.Question"
,
null
)
.
WithMany
()
.
HasForeignKey
(
"QuestionsId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
HasOne
(
"PSManagement.Domain.Reports.Entities.Section"
,
null
)
.
WithMany
()
.
HasForeignKey
(
"SectionsId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
});
modelBuilder
.
Entity
(
"UserRole"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Identity.Entities.Role"
,
null
)
.
WithMany
()
.
HasForeignKey
(
"RoleId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
HasOne
(
"PSManagement.Domain.Identity.Entities.User"
,
null
)
.
WithMany
()
.
HasForeignKey
(
"UserId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Customers.Entities.Customer"
,
b
=>
{
b
.
Navigation
(
"Projects"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Employees.Entities.Employee"
,
b
=>
{
b
.
Navigation
(
"EmployeeParticipates"
);
b
.
Navigation
(
"EmployeeTracks"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Identity.Entities.User"
,
b
=>
{
b
.
Navigation
(
"Employee"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Projects.Entities.Project"
,
b
=>
{
b
.
Navigation
(
"Attachments"
);
b
.
Navigation
(
"EmployeeParticipates"
);
b
.
Navigation
(
"FinancialSpending"
);
b
.
Navigation
(
"Steps"
);
b
.
Navigation
(
"Tracks"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Projects.Entities.Step"
,
b
=>
{
b
.
Navigation
(
"StepTracks"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.Report"
,
b
=>
{
b
.
Navigation
(
"Sections"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.ReportResult"
,
b
=>
{
b
.
Navigation
(
"Answers"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Tracking.Track"
,
b
=>
{
b
.
Navigation
(
"EmployeeTracks"
);
b
.
Navigation
(
"StepTracks"
);
});
#pragma warning restore 612, 618
}
}
}
PSManagement.Infrastructure.Persistence/Migrations/20240811203222_AddReports.cs
0 → 100644
View file @
1d47855f
using
Microsoft.EntityFrameworkCore.Migrations
;
namespace
PSManagement.Infrastructure.Persistence.Migrations
{
public
partial
class
AddReports
:
Migration
{
protected
override
void
Up
(
MigrationBuilder
migrationBuilder
)
{
migrationBuilder
.
CreateTable
(
name
:
"Question"
,
columns
:
table
=>
new
{
Id
=
table
.
Column
<
int
>(
type
:
"int"
,
nullable
:
false
)
.
Annotation
(
"SqlServer:Identity"
,
"1, 1"
),
QuestionName
=
table
.
Column
<
string
>(
type
:
"nvarchar(max)"
,
nullable
:
true
)
},
constraints
:
table
=>
{
table
.
PrimaryKey
(
"PK_Question"
,
x
=>
x
.
Id
);
});
migrationBuilder
.
CreateTable
(
name
:
"Reports"
,
columns
:
table
=>
new
{
Id
=
table
.
Column
<
int
>(
type
:
"int"
,
nullable
:
false
)
.
Annotation
(
"SqlServer:Identity"
,
"1, 1"
),
ReportName
=
table
.
Column
<
string
>(
type
:
"nvarchar(max)"
,
nullable
:
true
)
},
constraints
:
table
=>
{
table
.
PrimaryKey
(
"PK_Reports"
,
x
=>
x
.
Id
);
});
migrationBuilder
.
CreateTable
(
name
:
"ReportResults"
,
columns
:
table
=>
new
{
Id
=
table
.
Column
<
int
>(
type
:
"int"
,
nullable
:
false
)
.
Annotation
(
"SqlServer:Identity"
,
"1, 1"
),
ReportId
=
table
.
Column
<
int
>(
type
:
"int"
,
nullable
:
true
)
},
constraints
:
table
=>
{
table
.
PrimaryKey
(
"PK_ReportResults"
,
x
=>
x
.
Id
);
table
.
ForeignKey
(
name
:
"FK_ReportResults_Reports_ReportId"
,
column
:
x
=>
x
.
ReportId
,
principalTable
:
"Reports"
,
principalColumn
:
"Id"
,
onDelete
:
ReferentialAction
.
Restrict
);
});
migrationBuilder
.
CreateTable
(
name
:
"Section"
,
columns
:
table
=>
new
{
Id
=
table
.
Column
<
int
>(
type
:
"int"
,
nullable
:
false
)
.
Annotation
(
"SqlServer:Identity"
,
"1, 1"
),
SectionName
=
table
.
Column
<
string
>(
type
:
"nvarchar(max)"
,
nullable
:
true
),
ReportId
=
table
.
Column
<
int
>(
type
:
"int"
,
nullable
:
true
)
},
constraints
:
table
=>
{
table
.
PrimaryKey
(
"PK_Section"
,
x
=>
x
.
Id
);
table
.
ForeignKey
(
name
:
"FK_Section_Reports_ReportId"
,
column
:
x
=>
x
.
ReportId
,
principalTable
:
"Reports"
,
principalColumn
:
"Id"
,
onDelete
:
ReferentialAction
.
Restrict
);
});
migrationBuilder
.
CreateTable
(
name
:
"Answer"
,
columns
:
table
=>
new
{
Id
=
table
.
Column
<
int
>(
type
:
"int"
,
nullable
:
false
)
.
Annotation
(
"SqlServer:Identity"
,
"1, 1"
),
QuestionId
=
table
.
Column
<
int
>(
type
:
"int"
,
nullable
:
true
),
AnswerValue
=
table
.
Column
<
string
>(
type
:
"nvarchar(max)"
,
nullable
:
true
),
ReportResultId
=
table
.
Column
<
int
>(
type
:
"int"
,
nullable
:
true
)
},
constraints
:
table
=>
{
table
.
PrimaryKey
(
"PK_Answer"
,
x
=>
x
.
Id
);
table
.
ForeignKey
(
name
:
"FK_Answer_Question_QuestionId"
,
column
:
x
=>
x
.
QuestionId
,
principalTable
:
"Question"
,
principalColumn
:
"Id"
,
onDelete
:
ReferentialAction
.
Restrict
);
table
.
ForeignKey
(
name
:
"FK_Answer_ReportResults_ReportResultId"
,
column
:
x
=>
x
.
ReportResultId
,
principalTable
:
"ReportResults"
,
principalColumn
:
"Id"
,
onDelete
:
ReferentialAction
.
Restrict
);
});
migrationBuilder
.
CreateTable
(
name
:
"QuestionSection"
,
columns
:
table
=>
new
{
QuestionsId
=
table
.
Column
<
int
>(
type
:
"int"
,
nullable
:
false
),
SectionsId
=
table
.
Column
<
int
>(
type
:
"int"
,
nullable
:
false
)
},
constraints
:
table
=>
{
table
.
PrimaryKey
(
"PK_QuestionSection"
,
x
=>
new
{
x
.
QuestionsId
,
x
.
SectionsId
});
table
.
ForeignKey
(
name
:
"FK_QuestionSection_Question_QuestionsId"
,
column
:
x
=>
x
.
QuestionsId
,
principalTable
:
"Question"
,
principalColumn
:
"Id"
,
onDelete
:
ReferentialAction
.
Cascade
);
table
.
ForeignKey
(
name
:
"FK_QuestionSection_Section_SectionsId"
,
column
:
x
=>
x
.
SectionsId
,
principalTable
:
"Section"
,
principalColumn
:
"Id"
,
onDelete
:
ReferentialAction
.
Cascade
);
});
migrationBuilder
.
CreateIndex
(
name
:
"IX_Answer_QuestionId"
,
table
:
"Answer"
,
column
:
"QuestionId"
);
migrationBuilder
.
CreateIndex
(
name
:
"IX_Answer_ReportResultId"
,
table
:
"Answer"
,
column
:
"ReportResultId"
);
migrationBuilder
.
CreateIndex
(
name
:
"IX_QuestionSection_SectionsId"
,
table
:
"QuestionSection"
,
column
:
"SectionsId"
);
migrationBuilder
.
CreateIndex
(
name
:
"IX_ReportResults_ReportId"
,
table
:
"ReportResults"
,
column
:
"ReportId"
);
migrationBuilder
.
CreateIndex
(
name
:
"IX_Section_ReportId"
,
table
:
"Section"
,
column
:
"ReportId"
);
}
protected
override
void
Down
(
MigrationBuilder
migrationBuilder
)
{
migrationBuilder
.
DropTable
(
name
:
"Answer"
);
migrationBuilder
.
DropTable
(
name
:
"QuestionSection"
);
migrationBuilder
.
DropTable
(
name
:
"ReportResults"
);
migrationBuilder
.
DropTable
(
name
:
"Question"
);
migrationBuilder
.
DropTable
(
name
:
"Section"
);
migrationBuilder
.
DropTable
(
name
:
"Reports"
);
}
}
}
PSManagement.Infrastructure.Persistence/Migrations/AppDbContextModelSnapshot.cs
View file @
1d47855f
...
...
@@ -20,7 +20,7 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
.
HasAnnotation
(
"ProductVersion"
,
"5.0.17"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
modelBuilder
.
Entity
(
"PSManagement.Domain.Customers.
Aggregate
.Customer"
,
b
=>
modelBuilder
.
Entity
(
"PSManagement.Domain.Customers.
Entities
.Customer"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
...
...
@@ -349,6 +349,98 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
b
.
ToTable
(
"ProjectStatus"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.Answer"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"AnswerValue"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
Property
<
int
?>(
"QuestionId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
?>(
"ReportResultId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"QuestionId"
);
b
.
HasIndex
(
"ReportResultId"
);
b
.
ToTable
(
"Answer"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.Question"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"QuestionName"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Question"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.Report"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
string
>(
"ReportName"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
HasKey
(
"Id"
);
b
.
ToTable
(
"Reports"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.ReportResult"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
int
?>(
"ReportId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"ReportId"
);
b
.
ToTable
(
"ReportResults"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.Section"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"int"
)
.
HasAnnotation
(
"SqlServer:ValueGenerationStrategy"
,
SqlServerValueGenerationStrategy
.
IdentityColumn
);
b
.
Property
<
int
?>(
"ReportId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
string
>(
"SectionName"
)
.
HasColumnType
(
"nvarchar(max)"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"ReportId"
);
b
.
ToTable
(
"Section"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Tracking.EmployeeTrack"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
...
...
@@ -443,6 +535,21 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
b
.
ToTable
(
"PermissionRole"
);
});
modelBuilder
.
Entity
(
"QuestionSection"
,
b
=>
{
b
.
Property
<
int
>(
"QuestionsId"
)
.
HasColumnType
(
"int"
);
b
.
Property
<
int
>(
"SectionsId"
)
.
HasColumnType
(
"int"
);
b
.
HasKey
(
"QuestionsId"
,
"SectionsId"
);
b
.
HasIndex
(
"SectionsId"
);
b
.
ToTable
(
"QuestionSection"
);
});
modelBuilder
.
Entity
(
"UserRole"
,
b
=>
{
b
.
Property
<
int
>(
"RoleId"
)
...
...
@@ -465,7 +572,7 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
});
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Customers.
Aggregate
.Customer"
,
b
=>
modelBuilder
.
Entity
(
"PSManagement.Domain.Customers.
Entities
.Customer"
,
b
=>
{
b
.
OwnsMany
(
"PSManagement.Domain.Customers.Entities.ContactInfo"
,
"ContactInfo"
,
b1
=>
{
...
...
@@ -675,7 +782,7 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
modelBuilder
.
Entity
(
"PSManagement.Domain.Projects.Entities.Project"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Customers.
Aggregate
.Customer"
,
null
)
b
.
HasOne
(
"PSManagement.Domain.Customers.
Entities
.Customer"
,
null
)
.
WithMany
(
"Projects"
)
.
HasForeignKey
(
"CustomerId"
);
...
...
@@ -694,7 +801,7 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
.
WithMany
()
.
HasForeignKey
(
"ProjectStatusId"
);
b
.
HasOne
(
"PSManagement.Domain.Customers.
Aggregate
.Customer"
,
"Proposer"
)
b
.
HasOne
(
"PSManagement.Domain.Customers.
Entities
.Customer"
,
"Proposer"
)
.
WithMany
()
.
HasForeignKey
(
"ProposerId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
...
...
@@ -839,6 +946,37 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
b
.
Navigation
(
"Project"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.Answer"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Reports.Entities.Question"
,
"Question"
)
.
WithMany
()
.
HasForeignKey
(
"QuestionId"
);
b
.
HasOne
(
"PSManagement.Domain.Reports.Entities.ReportResult"
,
null
)
.
WithMany
(
"Answers"
)
.
HasForeignKey
(
"ReportResultId"
);
b
.
Navigation
(
"Question"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.ReportResult"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Reports.Entities.Report"
,
"Report"
)
.
WithMany
()
.
HasForeignKey
(
"ReportId"
);
b
.
Navigation
(
"Report"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.Section"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Reports.Entities.Report"
,
"Report"
)
.
WithMany
(
"Sections"
)
.
HasForeignKey
(
"ReportId"
);
b
.
Navigation
(
"Report"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Tracking.EmployeeTrack"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Employees.Entities.Employee"
,
"Employee"
)
...
...
@@ -903,6 +1041,21 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
.
IsRequired
();
});
modelBuilder
.
Entity
(
"QuestionSection"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Reports.Entities.Question"
,
null
)
.
WithMany
()
.
HasForeignKey
(
"QuestionsId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
HasOne
(
"PSManagement.Domain.Reports.Entities.Section"
,
null
)
.
WithMany
()
.
HasForeignKey
(
"SectionsId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
});
modelBuilder
.
Entity
(
"UserRole"
,
b
=>
{
b
.
HasOne
(
"PSManagement.Domain.Identity.Entities.Role"
,
null
)
...
...
@@ -918,7 +1071,7 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
.
IsRequired
();
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Customers.
Aggregate
.Customer"
,
b
=>
modelBuilder
.
Entity
(
"PSManagement.Domain.Customers.
Entities
.Customer"
,
b
=>
{
b
.
Navigation
(
"Projects"
);
});
...
...
@@ -953,6 +1106,16 @@ namespace PSManagement.Infrastructure.Persistence.Migrations
b
.
Navigation
(
"StepTracks"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.Report"
,
b
=>
{
b
.
Navigation
(
"Sections"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Reports.Entities.ReportResult"
,
b
=>
{
b
.
Navigation
(
"Answers"
);
});
modelBuilder
.
Entity
(
"PSManagement.Domain.Tracking.Track"
,
b
=>
{
b
.
Navigation
(
"EmployeeTracks"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment