Skip to content

Commit babc3a8

Browse files
committed
Add MQ Schema tables
1 parent eebd335 commit babc3a8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1236
-395
lines changed

TestDatabases/SQLServer/EfrpgTest (manually created).sql

Lines changed: 416 additions & 382 deletions
Large diffs are not rendered by default.
2.87 KB
Binary file not shown.
0 Bytes
Binary file not shown.

TestDatabases/SQLServer/EfrpgTest_Synonyms.sql

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
USE [master]
22
GO
3-
/****** Object: Database [EfrpgTest_Synonyms] Script Date: 12/01/22 23:26:21 ******/
3+
/****** Object: Database [EfrpgTest_Synonyms] Script Date: 26/05/22 21:57:11 ******/
44
CREATE DATABASE [EfrpgTest_Synonyms]
55
CONTAINMENT = NONE
66
ON PRIMARY
@@ -79,30 +79,31 @@ ALTER DATABASE [EfrpgTest_Synonyms] SET QUERY_STORE = OFF
7979
GO
8080
USE [EfrpgTest_Synonyms]
8181
GO
82-
/****** Object: Schema [CustomSchema] Script Date: 12/01/22 23:26:21 ******/
82+
/****** Object: Schema [CustomSchema] Script Date: 26/05/22 21:57:11 ******/
8383
CREATE SCHEMA [CustomSchema]
8484
GO
85-
/****** Object: Schema [Stafford] Script Date: 12/01/22 23:26:21 ******/
85+
/****** Object: Schema [Stafford] Script Date: 26/05/22 21:57:11 ******/
8686
CREATE SCHEMA [Stafford]
8787
GO
88-
/****** Object: Schema [Synonyms] Script Date: 12/01/22 23:26:21 ******/
88+
/****** Object: Schema [Synonyms] Script Date: 26/05/22 21:57:11 ******/
8989
CREATE SCHEMA [Synonyms]
9090
GO
91-
/****** Object: Synonym [CustomSchema].[CsvToIntWithSchema] Script Date: 12/01/22 23:26:21 ******/
91+
/****** Object: Synonym [CustomSchema].[CsvToIntWithSchema] Script Date: 26/05/22 21:57:11 ******/
9292
CREATE SYNONYM [CustomSchema].[CsvToIntWithSchema] FOR [EfrpgTest].[CustomSchema].[CsvToIntWithSchema]
9393
GO
94-
/****** Object: Synonym [Synonyms].[Child] Script Date: 12/01/22 23:26:21 ******/
94+
/****** Object: Synonym [dbo].[CarWithDifferentSynonymName] Script Date: 26/05/22 21:57:11 ******/
95+
CREATE SYNONYM [dbo].[CarWithDifferentSynonymName] FOR [EfrpgTest].[dbo].[Car]
96+
GO
97+
/****** Object: Synonym [Synonyms].[Child] Script Date: 26/05/22 21:57:11 ******/
9598
CREATE SYNONYM [Synonyms].[Child] FOR [EfrpgTest].[Synonyms].[Child]
9699
GO
97-
/****** Object: Synonym [Synonyms].[Parent] Script Date: 12/01/22 23:26:21 ******/
100+
/****** Object: Synonym [Synonyms].[Parent] Script Date: 26/05/22 21:57:11 ******/
98101
CREATE SYNONYM [Synonyms].[Parent] FOR [EfrpgTest].[Synonyms].[Parent]
99102
GO
100-
/****** Object: Synonym [Synonyms].[SimpleStoredProc] Script Date: 12/01/22 23:26:21 ******/
103+
/****** Object: Synonym [Synonyms].[SimpleStoredProc] Script Date: 26/05/22 21:57:11 ******/
101104
CREATE SYNONYM [Synonyms].[SimpleStoredProc] FOR [EfrpgTest].[Synonyms].[SimpleStoredProc]
102105
GO
103-
CREATE SYNONYM [CarWithDifferentSynonymName] FOR [EfrpgTest].[dbo].[Car]
104-
GO
105-
/****** Object: UserDefinedFunction [dbo].[CsvToInt] Script Date: 12/01/22 23:26:21 ******/
106+
/****** Object: UserDefinedFunction [dbo].[CsvToInt] Script Date: 26/05/22 21:57:11 ******/
106107
SET ANSI_NULLS ON
107108
GO
108109
SET QUOTED_IDENTIFIER ON
@@ -143,7 +144,7 @@ BEGIN
143144
RETURN
144145
END
145146
GO
146-
/****** Object: Table [dbo].[UserInfo] Script Date: 12/01/22 23:26:21 ******/
147+
/****** Object: Table [dbo].[UserInfo] Script Date: 26/05/22 21:57:11 ******/
147148
SET ANSI_NULLS ON
148149
GO
149150
SET QUOTED_IDENTIFIER ON
@@ -157,7 +158,7 @@ CREATE TABLE [dbo].[UserInfo](
157158
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
158159
) ON [PRIMARY]
159160
GO
160-
/****** Object: Table [dbo].[UserInfoAttributes] Script Date: 12/01/22 23:26:21 ******/
161+
/****** Object: Table [dbo].[UserInfoAttributes] Script Date: 26/05/22 21:57:12 ******/
161162
SET ANSI_NULLS ON
162163
GO
163164
SET QUOTED_IDENTIFIER ON
@@ -176,6 +177,12 @@ SET IDENTITY_INSERT [dbo].[UserInfo] ON
176177
GO
177178
INSERT [dbo].[UserInfo] ([Id], [Forename]) VALUES (1, N'Ruprecht')
178179
GO
180+
INSERT [dbo].[UserInfo] ([Id], [Forename]) VALUES (2, N'Ruprecht')
181+
GO
182+
INSERT [dbo].[UserInfo] ([Id], [Forename]) VALUES (3, N'Ruprecht')
183+
GO
184+
INSERT [dbo].[UserInfo] ([Id], [Forename]) VALUES (4, N'Ruprecht')
185+
GO
179186
SET IDENTITY_INSERT [dbo].[UserInfo] OFF
180187
GO
181188
ALTER TABLE [dbo].[UserInfoAttributes] WITH CHECK ADD CONSTRAINT [FK_UserInfoAttributes_PrimaryUserInfo] FOREIGN KEY([PrimaryId])
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// <auto-generated>
2+
3+
using Microsoft.EntityFrameworkCore;
4+
using Microsoft.EntityFrameworkCore.Metadata.Builders;
5+
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
6+
7+
namespace V6EfrpgTest
8+
{
9+
// ApplicationUsers
10+
public class MQ_ApplicationUserConfiguration : IEntityTypeConfiguration<MQ_ApplicationUser>
11+
{
12+
public void Configure(EntityTypeBuilder<MQ_ApplicationUser> builder)
13+
{
14+
builder.ToTable("ApplicationUsers", "MQ");
15+
builder.HasKey(x => x.Id).HasName("PK_MQ_ApplicationUsers").IsClustered();
16+
17+
builder.Property(x => x.Id).HasColumnName(@"Id").HasColumnType("int").IsRequired().ValueGeneratedOnAdd().UseIdentityColumn();
18+
}
19+
}
20+
21+
}
22+
// </auto-generated>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// <auto-generated>
2+
3+
using Microsoft.EntityFrameworkCore;
4+
using Microsoft.EntityFrameworkCore.Metadata.Builders;
5+
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
6+
7+
namespace V6EfrpgTest
8+
{
9+
// Logs
10+
public class MQ_LogConfiguration : IEntityTypeConfiguration<MQ_Log>
11+
{
12+
public void Configure(EntityTypeBuilder<MQ_Log> builder)
13+
{
14+
builder.ToTable("Logs", "MQ");
15+
builder.HasKey(x => x.Id).HasName("PK_MQ_Logs").IsClustered();
16+
17+
builder.Property(x => x.Id).HasColumnName(@"Id").HasColumnType("int").IsRequired().ValueGeneratedOnAdd().UseIdentityColumn();
18+
builder.Property(x => x.UserId).HasColumnName(@"UserId").HasColumnType("int").IsRequired(false);
19+
builder.Property(x => x.ImpersonatingUserId).HasColumnName(@"ImpersonatingUserId").HasColumnType("int").IsRequired(false);
20+
21+
// Foreign keys
22+
builder.HasOne(a => a.ImpersonatingUser).WithMany(b => b.MQ_Logs_ImpersonatingUserId).HasForeignKey(c => c.ImpersonatingUserId).OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("FK_MQ_LOGS__ImpersonatingUser");
23+
builder.HasOne(a => a.User).WithMany(b => b.MQ_Logs_UserId).HasForeignKey(c => c.UserId).OnDelete(DeleteBehavior.ClientSetNull).HasConstraintName("FK_MQ_LOGS__User");
24+
}
25+
}
26+
27+
}
28+
// </auto-generated>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// <auto-generated>
2+
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Threading;
6+
using System.Threading.Tasks;
7+
8+
namespace V6EfrpgTest
9+
{
10+
// ApplicationUsers
11+
public class MQ_ApplicationUser
12+
{
13+
public int Id { get; set; } // Id (Primary key)
14+
15+
// Reverse navigation
16+
17+
/// <summary>
18+
/// Child MQ_Logs where [Logs].[ImpersonatingUserId] point to this entity (FK_MQ_LOGS__ImpersonatingUser)
19+
/// </summary>
20+
public virtual ICollection<MQ_Log> MQ_Logs_ImpersonatingUserId { get; set; } // Logs.FK_MQ_LOGS__ImpersonatingUser
21+
22+
/// <summary>
23+
/// Child MQ_Logs where [Logs].[UserId] point to this entity (FK_MQ_LOGS__User)
24+
/// </summary>
25+
public virtual ICollection<MQ_Log> MQ_Logs_UserId { get; set; } // Logs.FK_MQ_LOGS__User
26+
27+
public MQ_ApplicationUser()
28+
{
29+
MQ_Logs_ImpersonatingUserId = new List<MQ_Log>();
30+
MQ_Logs_UserId = new List<MQ_Log>();
31+
}
32+
}
33+
34+
}
35+
// </auto-generated>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// <auto-generated>
2+
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Threading;
6+
using System.Threading.Tasks;
7+
8+
namespace V6EfrpgTest
9+
{
10+
// Logs
11+
public class MQ_Log
12+
{
13+
public int Id { get; set; } // Id (Primary key)
14+
public int? UserId { get; set; } // UserId
15+
public int? ImpersonatingUserId { get; set; } // ImpersonatingUserId
16+
17+
// Foreign keys
18+
19+
/// <summary>
20+
/// Parent MQ_ApplicationUser pointed by [Logs].([ImpersonatingUserId]) (FK_MQ_LOGS__ImpersonatingUser)
21+
/// </summary>
22+
public virtual MQ_ApplicationUser ImpersonatingUser { get; set; } // FK_MQ_LOGS__ImpersonatingUser
23+
24+
/// <summary>
25+
/// Parent MQ_ApplicationUser pointed by [Logs].([UserId]) (FK_MQ_LOGS__User)
26+
/// </summary>
27+
public virtual MQ_ApplicationUser User { get; set; } // FK_MQ_LOGS__User
28+
}
29+
30+
}
31+
// </auto-generated>

Tester.Integration.EFCore6/EfrpgTestData/FakeV6EfrpgTestDbContext.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ public class FakeV6EfrpgTestDbContext : IV6EfrpgTestDbContext
7474
public DbSet<Issue47_Role> Issue47_Roles { get; set; } // Role
7575
public DbSet<Issue47_User> Issue47_Users { get; set; } // Users
7676
public DbSet<Issue47_UserRole> Issue47_UserRoles { get; set; } // UserRoles
77+
public DbSet<MQ_ApplicationUser> MQ_ApplicationUsers { get; set; } // ApplicationUsers
78+
public DbSet<MQ_Log> MQ_Logs { get; set; } // Logs
7779
public DbSet<MultipleKey> MultipleKeys { get; set; } // MultipleKeys
7880
public DbSet<OneEightSix_Issue> OneEightSix_Issues { get; set; } // Issue
7981
public DbSet<OneEightSix_UploadedFile> OneEightSix_UploadedFiles { get; set; } // UploadedFile
@@ -177,6 +179,8 @@ public FakeV6EfrpgTestDbContext()
177179
Issue47_Roles = new FakeDbSet<Issue47_Role>("RoleId");
178180
Issue47_Users = new FakeDbSet<Issue47_User>("UserId");
179181
Issue47_UserRoles = new FakeDbSet<Issue47_UserRole>("UserRoleId");
182+
MQ_ApplicationUsers = new FakeDbSet<MQ_ApplicationUser>("Id");
183+
MQ_Logs = new FakeDbSet<MQ_Log>("Id");
180184
MultipleKeys = new FakeDbSet<MultipleKey>("UserId", "FavouriteColourId", "BestHolidayTypeId");
181185
OneEightSix_Issues = new FakeDbSet<OneEightSix_Issue>("Id");
182186
OneEightSix_UploadedFiles = new FakeDbSet<OneEightSix_UploadedFile>("Id");

Tester.Integration.EFCore6/EfrpgTestData/Interface/IV6EfrpgTestDbContext.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,8 @@ public interface IV6EfrpgTestDbContext : IDisposable
7474
DbSet<Issue47_Role> Issue47_Roles { get; set; } // Role
7575
DbSet<Issue47_User> Issue47_Users { get; set; } // Users
7676
DbSet<Issue47_UserRole> Issue47_UserRoles { get; set; } // UserRoles
77+
DbSet<MQ_ApplicationUser> MQ_ApplicationUsers { get; set; } // ApplicationUsers
78+
DbSet<MQ_Log> MQ_Logs { get; set; } // Logs
7779
DbSet<MultipleKey> MultipleKeys { get; set; } // MultipleKeys
7880
DbSet<OneEightSix_Issue> OneEightSix_Issues { get; set; } // Issue
7981
DbSet<OneEightSix_UploadedFile> OneEightSix_UploadedFiles { get; set; } // UploadedFile

0 commit comments

Comments
 (0)