Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tsi1-backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Rodrigo Sastre Marotta
tsi1-backend
Merge requests
!20
merge from develop
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
merge from develop
develop
into
master
Overview
0
Commits
39
Pipelines
1
Changes
3
Merged
Lucca Santangelo Dodera
requested to merge
develop
into
master
4 years ago
Overview
0
Commits
39
Pipelines
1
Changes
3
Expand
0
0
Merge request reports
Viewing commit
021c3d26
Prev
Next
Show latest version
3 files
+
580
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
021c3d26
add migration
· 021c3d26
esantangelo
authored
4 years ago
Tsi1.Api/Tsi1.DataLayer/Migrations/20201029004502_added-entities-Group-and-Connection.Designer.cs
0 → 100644
+
491
−
0
Options
// <auto-generated />
using
System
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore.Infrastructure
;
using
Microsoft.EntityFrameworkCore.Migrations
;
using
Microsoft.EntityFrameworkCore.Storage.ValueConversion
;
using
Npgsql.EntityFrameworkCore.PostgreSQL.Metadata
;
using
Tsi1.DataLayer
;
namespace
Tsi1.DataLayer.Migrations
{
[
DbContext
(
typeof
(
Tsi1Context
))]
[
Migration
(
"20201029004502_added-entities-Group-and-Connection"
)]
partial
class
addedentitiesGroupandConnection
{
protected
override
void
BuildTargetModel
(
ModelBuilder
modelBuilder
)
{
#pragma warning disable 612, 618
modelBuilder
.
HasAnnotation
(
"Npgsql:ValueGenerationStrategy"
,
NpgsqlValueGenerationStrategy
.
IdentityByDefaultColumn
)
.
HasAnnotation
(
"ProductVersion"
,
"3.1.4"
)
.
HasAnnotation
(
"Relational:MaxIdentifierLength"
,
63
);
modelBuilder
.
Entity
(
"Tsi1.DataLayer.Entities.Connection"
,
b
=>
{
b
.
Property
<
string
>(
"ConnectionId"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
string
>(
"GroupName"
)
.
HasColumnType
(
"text"
);
b
.
Property
<
int
>(
"UserId"
)
.
HasColumnType
(
"integer"
);
b
.
HasKey
(
"ConnectionId"
);
b
.
HasIndex
(
"GroupName"
);
b
.
ToTable
(
"Connections"
);
});
modelBuilder
.
Entity
(
"Tsi1.DataLayer.Entities.Course"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"integer"
)
.
HasAnnotation
(
"Npgsql:ValueGenerationStrategy"
,
NpgsqlValueGenerationStrategy
.
IdentityByDefaultColumn
);
b
.
Property
<
string
>(
"Name"
)
.
IsRequired
()
.
HasColumnType
(
"character varying(50)"
);
b
.
Property
<
int
>(
"TenantId"
)
.
HasColumnType
(
"integer"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"TenantId"
);
b
.
HasIndex
(
"Name"
,
"TenantId"
)
.
IsUnique
();
b
.
ToTable
(
"Courses"
);
});
modelBuilder
.
Entity
(
"Tsi1.DataLayer.Entities.Forum"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"integer"
)
.
HasAnnotation
(
"Npgsql:ValueGenerationStrategy"
,
NpgsqlValueGenerationStrategy
.
IdentityByDefaultColumn
);
b
.
Property
<
int
>(
"CourseId"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
string
>(
"Name"
)
.
IsRequired
()
.
HasColumnType
(
"character varying(50)"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"CourseId"
,
"Name"
)
.
IsUnique
();
b
.
ToTable
(
"Forums"
);
});
modelBuilder
.
Entity
(
"Tsi1.DataLayer.Entities.ForumUser"
,
b
=>
{
b
.
Property
<
int
>(
"ForumId"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
int
>(
"UserId"
)
.
HasColumnType
(
"integer"
);
b
.
HasKey
(
"ForumId"
,
"UserId"
);
b
.
HasIndex
(
"UserId"
);
b
.
ToTable
(
"ForumUsers"
);
});
modelBuilder
.
Entity
(
"Tsi1.DataLayer.Entities.Group"
,
b
=>
{
b
.
Property
<
string
>(
"Name"
)
.
HasColumnType
(
"text"
);
b
.
HasKey
(
"Name"
);
b
.
ToTable
(
"Groups"
);
});
modelBuilder
.
Entity
(
"Tsi1.DataLayer.Entities.Post"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"integer"
)
.
HasAnnotation
(
"Npgsql:ValueGenerationStrategy"
,
NpgsqlValueGenerationStrategy
.
IdentityByDefaultColumn
);
b
.
Property
<
DateTime
>(
"Date"
)
.
HasColumnType
(
"timestamp without time zone"
);
b
.
Property
<
int
>(
"ForumId"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
string
>(
"Title"
)
.
IsRequired
()
.
HasColumnType
(
"character varying(100)"
);
b
.
Property
<
int
>(
"UserId"
)
.
HasColumnType
(
"integer"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"UserId"
);
b
.
HasIndex
(
"ForumId"
,
"Title"
)
.
IsUnique
();
b
.
ToTable
(
"Posts"
);
});
modelBuilder
.
Entity
(
"Tsi1.DataLayer.Entities.PostMessage"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"integer"
)
.
HasAnnotation
(
"Npgsql:ValueGenerationStrategy"
,
NpgsqlValueGenerationStrategy
.
IdentityByDefaultColumn
);
b
.
Property
<
string
>(
"Content"
)
.
IsRequired
()
.
HasColumnType
(
"character varying(10485760)"
);
b
.
Property
<
DateTime
>(
"Date"
)
.
HasColumnType
(
"timestamp without time zone"
);
b
.
Property
<
int
>(
"PostId"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
int
>(
"UserId"
)
.
HasColumnType
(
"integer"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"PostId"
);
b
.
HasIndex
(
"UserId"
);
b
.
ToTable
(
"PostMessages"
);
});
modelBuilder
.
Entity
(
"Tsi1.DataLayer.Entities.Professor"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"integer"
)
.
HasAnnotation
(
"Npgsql:ValueGenerationStrategy"
,
NpgsqlValueGenerationStrategy
.
IdentityByDefaultColumn
);
b
.
Property
<
string
>(
"IdentityCard"
)
.
IsRequired
()
.
HasColumnType
(
"character varying(50)"
);
b
.
Property
<
int
>(
"TenantId"
)
.
HasColumnType
(
"integer"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"TenantId"
);
b
.
HasIndex
(
"IdentityCard"
,
"TenantId"
)
.
IsUnique
();
b
.
ToTable
(
"Professors"
);
});
modelBuilder
.
Entity
(
"Tsi1.DataLayer.Entities.ProfessorCourse"
,
b
=>
{
b
.
Property
<
int
>(
"ProfessorId"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
int
>(
"CourseId"
)
.
HasColumnType
(
"integer"
);
b
.
HasKey
(
"ProfessorId"
,
"CourseId"
);
b
.
HasIndex
(
"CourseId"
);
b
.
ToTable
(
"ProfessorCourses"
);
});
modelBuilder
.
Entity
(
"Tsi1.DataLayer.Entities.Student"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"integer"
)
.
HasAnnotation
(
"Npgsql:ValueGenerationStrategy"
,
NpgsqlValueGenerationStrategy
.
IdentityByDefaultColumn
);
b
.
Property
<
int
>(
"Age"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
string
>(
"IdentityCard"
)
.
IsRequired
()
.
HasColumnType
(
"character varying(50)"
);
b
.
Property
<
int
>(
"TenantId"
)
.
HasColumnType
(
"integer"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"TenantId"
);
b
.
HasIndex
(
"IdentityCard"
,
"TenantId"
)
.
IsUnique
();
b
.
ToTable
(
"Students"
);
});
modelBuilder
.
Entity
(
"Tsi1.DataLayer.Entities.StudentCourse"
,
b
=>
{
b
.
Property
<
int
>(
"StudentId"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
int
>(
"CourseId"
)
.
HasColumnType
(
"integer"
);
b
.
HasKey
(
"StudentId"
,
"CourseId"
);
b
.
HasIndex
(
"CourseId"
);
b
.
ToTable
(
"StudentCourses"
);
});
modelBuilder
.
Entity
(
"Tsi1.DataLayer.Entities.Tenant"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"integer"
)
.
HasAnnotation
(
"Npgsql:ValueGenerationStrategy"
,
NpgsqlValueGenerationStrategy
.
IdentityByDefaultColumn
);
b
.
Property
<
string
>(
"Name"
)
.
IsRequired
()
.
HasColumnType
(
"character varying(50)"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"Name"
)
.
IsUnique
();
b
.
ToTable
(
"Tenants"
);
});
modelBuilder
.
Entity
(
"Tsi1.DataLayer.Entities.User"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"integer"
)
.
HasAnnotation
(
"Npgsql:ValueGenerationStrategy"
,
NpgsqlValueGenerationStrategy
.
IdentityByDefaultColumn
);
b
.
Property
<
string
>(
"Email"
)
.
IsRequired
()
.
HasColumnType
(
"character varying(255)"
);
b
.
Property
<
string
>(
"FirstName"
)
.
IsRequired
()
.
HasColumnType
(
"character varying(255)"
);
b
.
Property
<
string
>(
"LastName"
)
.
IsRequired
()
.
HasColumnType
(
"character varying(255)"
);
b
.
Property
<
string
>(
"Password"
)
.
IsRequired
()
.
HasColumnType
(
"character varying(255)"
);
b
.
Property
<
int
?>(
"ProfessorId"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
int
?>(
"StudentId"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
int
>(
"TenantId"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
int
>(
"UserTypeId"
)
.
HasColumnType
(
"integer"
);
b
.
Property
<
string
>(
"Username"
)
.
IsRequired
()
.
HasColumnType
(
"character varying(50)"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"ProfessorId"
)
.
IsUnique
();
b
.
HasIndex
(
"StudentId"
)
.
IsUnique
();
b
.
HasIndex
(
"TenantId"
);
b
.
HasIndex
(
"UserTypeId"
);
b
.
HasIndex
(
"Username"
,
"TenantId"
)
.
IsUnique
();
b
.
ToTable
(
"Users"
);
});
modelBuilder
.
Entity
(
"Tsi1.DataLayer.Entities.UserType"
,
b
=>
{
b
.
Property
<
int
>(
"Id"
)
.
ValueGeneratedOnAdd
()
.
HasColumnType
(
"integer"
)
.
HasAnnotation
(
"Npgsql:ValueGenerationStrategy"
,
NpgsqlValueGenerationStrategy
.
IdentityByDefaultColumn
);
b
.
Property
<
string
>(
"Name"
)
.
IsRequired
()
.
HasColumnType
(
"character varying(50)"
);
b
.
HasKey
(
"Id"
);
b
.
HasIndex
(
"Name"
)
.
IsUnique
();
b
.
ToTable
(
"UserTypes"
);
});
modelBuilder
.
Entity
(
"Tsi1.DataLayer.Entities.Connection"
,
b
=>
{
b
.
HasOne
(
"Tsi1.DataLayer.Entities.Group"
,
"Group"
)
.
WithMany
(
"Connections"
)
.
HasForeignKey
(
"GroupName"
);
});
modelBuilder
.
Entity
(
"Tsi1.DataLayer.Entities.Course"
,
b
=>
{
b
.
HasOne
(
"Tsi1.DataLayer.Entities.Tenant"
,
"Tenant"
)
.
WithMany
(
"Courses"
)
.
HasForeignKey
(
"TenantId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
});
modelBuilder
.
Entity
(
"Tsi1.DataLayer.Entities.Forum"
,
b
=>
{
b
.
HasOne
(
"Tsi1.DataLayer.Entities.Course"
,
"Course"
)
.
WithMany
(
"Forums"
)
.
HasForeignKey
(
"CourseId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
});
modelBuilder
.
Entity
(
"Tsi1.DataLayer.Entities.ForumUser"
,
b
=>
{
b
.
HasOne
(
"Tsi1.DataLayer.Entities.Forum"
,
"Forum"
)
.
WithMany
(
"ForumUsers"
)
.
HasForeignKey
(
"ForumId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
HasOne
(
"Tsi1.DataLayer.Entities.User"
,
"User"
)
.
WithMany
(
"ForumUsers"
)
.
HasForeignKey
(
"UserId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
});
modelBuilder
.
Entity
(
"Tsi1.DataLayer.Entities.Post"
,
b
=>
{
b
.
HasOne
(
"Tsi1.DataLayer.Entities.Forum"
,
"Forum"
)
.
WithMany
(
"Posts"
)
.
HasForeignKey
(
"ForumId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
HasOne
(
"Tsi1.DataLayer.Entities.User"
,
"User"
)
.
WithMany
(
"Posts"
)
.
HasForeignKey
(
"UserId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
});
modelBuilder
.
Entity
(
"Tsi1.DataLayer.Entities.PostMessage"
,
b
=>
{
b
.
HasOne
(
"Tsi1.DataLayer.Entities.Post"
,
"Post"
)
.
WithMany
(
"PostMessages"
)
.
HasForeignKey
(
"PostId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
HasOne
(
"Tsi1.DataLayer.Entities.User"
,
"User"
)
.
WithMany
(
"PostMessages"
)
.
HasForeignKey
(
"UserId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
});
modelBuilder
.
Entity
(
"Tsi1.DataLayer.Entities.Professor"
,
b
=>
{
b
.
HasOne
(
"Tsi1.DataLayer.Entities.Tenant"
,
"Tenant"
)
.
WithMany
(
"Professors"
)
.
HasForeignKey
(
"TenantId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
});
modelBuilder
.
Entity
(
"Tsi1.DataLayer.Entities.ProfessorCourse"
,
b
=>
{
b
.
HasOne
(
"Tsi1.DataLayer.Entities.Course"
,
"Course"
)
.
WithMany
(
"ProfessorCourses"
)
.
HasForeignKey
(
"CourseId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
HasOne
(
"Tsi1.DataLayer.Entities.Professor"
,
"Professor"
)
.
WithMany
(
"ProfessorCourses"
)
.
HasForeignKey
(
"ProfessorId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
});
modelBuilder
.
Entity
(
"Tsi1.DataLayer.Entities.Student"
,
b
=>
{
b
.
HasOne
(
"Tsi1.DataLayer.Entities.Tenant"
,
"Tenant"
)
.
WithMany
(
"Students"
)
.
HasForeignKey
(
"TenantId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
});
modelBuilder
.
Entity
(
"Tsi1.DataLayer.Entities.StudentCourse"
,
b
=>
{
b
.
HasOne
(
"Tsi1.DataLayer.Entities.Course"
,
"Course"
)
.
WithMany
(
"StudentCourses"
)
.
HasForeignKey
(
"CourseId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
HasOne
(
"Tsi1.DataLayer.Entities.Student"
,
"Student"
)
.
WithMany
(
"StudentCourses"
)
.
HasForeignKey
(
"StudentId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
});
modelBuilder
.
Entity
(
"Tsi1.DataLayer.Entities.User"
,
b
=>
{
b
.
HasOne
(
"Tsi1.DataLayer.Entities.Professor"
,
"Professor"
)
.
WithOne
(
"User"
)
.
HasForeignKey
(
"Tsi1.DataLayer.Entities.User"
,
"ProfessorId"
);
b
.
HasOne
(
"Tsi1.DataLayer.Entities.Student"
,
"Student"
)
.
WithOne
(
"User"
)
.
HasForeignKey
(
"Tsi1.DataLayer.Entities.User"
,
"StudentId"
);
b
.
HasOne
(
"Tsi1.DataLayer.Entities.Tenant"
,
"Tenant"
)
.
WithMany
(
"Users"
)
.
HasForeignKey
(
"TenantId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
b
.
HasOne
(
"Tsi1.DataLayer.Entities.UserType"
,
"UserType"
)
.
WithMany
()
.
HasForeignKey
(
"UserTypeId"
)
.
OnDelete
(
DeleteBehavior
.
Cascade
)
.
IsRequired
();
});
#pragma warning restore 612, 618
}
}
}
Loading