File tree Expand file tree Collapse file tree
AppAny.Quartz.EntityFrameworkCore.Migrations.MySql/EntityTypeConfigurations
AppAny.Quartz.EntityFrameworkCore.Migrations.PostgreSQL/EntityTypeConfigurations
AppAny.Quartz.EntityFrameworkCore.Migrations.SQLite/EntityTypeConfigurations
AppAny.Quartz.EntityFrameworkCore.Migrations.SqlServer/EntityTypeConfigurations
AppAny.Quartz.EntityFrameworkCore.Migrations/Quartz
AppAny.Quartz.EntityFrameworkCore.Migrations.MySql.Tests
AppAny.Quartz.EntityFrameworkCore.Migrations.PostgreSQL.Tests
AppAny.Quartz.EntityFrameworkCore.Migrations.SQLite.Tests
AppAny.Quartz.EntityFrameworkCore.Migrations.SqlServer.Tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -78,6 +78,10 @@ public void Configure(EntityTypeBuilder<QuartzTrigger> builder)
7878 . HasColumnName ( "END_TIME" )
7979 . HasColumnType ( "bigint(19)" ) ;
8080
81+ builder . Property ( x => x . MisfireOriginalFireTime )
82+ . HasColumnName ( "MISFIRE_ORIG_FIRE_TIME" )
83+ . HasColumnType ( "bigint(19)" ) ;
84+
8185 builder . Property ( x => x . CalendarName )
8286 . HasColumnName ( "CALENDAR_NAME" )
8387 . HasColumnType ( "varchar(200)" ) ;
Original file line number Diff line number Diff line change @@ -80,6 +80,10 @@ public void Configure(EntityTypeBuilder<QuartzTrigger> builder)
8080 . HasColumnName ( "end_time" )
8181 . HasColumnType ( "bigint" ) ;
8282
83+ builder . Property ( x => x . MisfireOriginalFireTime )
84+ . HasColumnName ( "misfire_orig_fire_time" )
85+ . HasColumnType ( "bigint" ) ;
86+
8387 builder . Property ( x => x . CalendarName )
8488 . HasColumnName ( "calendar_name" )
8589 . HasColumnType ( "text" ) ;
Original file line number Diff line number Diff line change @@ -78,6 +78,10 @@ public void Configure(EntityTypeBuilder<QuartzTrigger> builder)
7878 . HasColumnName ( "END_TIME" )
7979 . HasColumnType ( "bigint" ) ;
8080
81+ builder . Property ( x => x . MisfireOriginalFireTime )
82+ . HasColumnName ( "MISFIRE_ORIG_FIRE_TIME" )
83+ . HasColumnType ( "bigint" ) ;
84+
8185 builder . Property ( x => x . CalendarName )
8286 . HasColumnName ( "CALENDAR_NAME" )
8387 . HasColumnType ( "text" ) ;
Original file line number Diff line number Diff line change @@ -84,6 +84,10 @@ public void Configure(EntityTypeBuilder<QuartzTrigger> builder)
8484 . HasColumnName ( "END_TIME" )
8585 . HasColumnType ( "bigint" ) ;
8686
87+ builder . Property ( x => x . MisfireOriginalFireTime )
88+ . HasColumnName ( "MISFIRE_ORIG_FIRE_TIME" )
89+ . HasColumnType ( "bigint" ) ;
90+
8791 builder . Property ( x => x . CalendarName )
8892 . HasColumnName ( "CALENDAR_NAME" )
8993 . HasMaxLength ( 200 )
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ public class QuartzTrigger
1717 public string TriggerType { get ; set ; } = null ! ;
1818 public long StartTime { get ; set ; }
1919 public long ? EndTime { get ; set ; }
20+ public long ? MisfireOriginalFireTime { get ; set ; }
2021 public string ? CalendarName { get ; set ; } = null ! ;
2122 public short ? MisfireInstruction { get ; set ; }
2223 public byte [ ] ? JobData { get ; set ; }
Original file line number Diff line number Diff line change 1+ namespace AppAny . Quartz . EntityFrameworkCore . Migrations . MySql . Tests ;
2+
3+ using AppAny . Quartz . EntityFrameworkCore . Migrations ;
4+ using Microsoft . EntityFrameworkCore ;
5+ using Microsoft . EntityFrameworkCore . Metadata ;
6+
7+ public class QuartzTriggerModelMappingTests
8+ {
9+ [ Fact ]
10+ public void ShouldMapMisfireOriginalFireTimeColumn ( )
11+ {
12+ var options = new DbContextOptionsBuilder < MySqlIntegrationDbContext > ( )
13+ . UseMySql (
14+ "Server=localhost;Port=3306;Database=quartz_mapping_tests;User=root;Password=password" ,
15+ ServerVersion . Parse ( "8.0.36-mysql" ) )
16+ . Options ;
17+
18+ using var dbContext = new MySqlIntegrationDbContext ( options ) ;
19+ var entityType = dbContext . Model . FindEntityType ( typeof ( QuartzTrigger ) ) ;
20+
21+ Assert . NotNull ( entityType ) ;
22+
23+ var property = entityType ! . FindProperty ( nameof ( QuartzTrigger . MisfireOriginalFireTime ) ) ;
24+ Assert . NotNull ( property ) ;
25+
26+ var table = StoreObjectIdentifier . Table ( entityType . GetTableName ( ) ! , entityType . GetSchema ( ) ) ;
27+ Assert . Equal ( "MISFIRE_ORIG_FIRE_TIME" , property ! . GetColumnName ( table ) ) ;
28+ Assert . Equal ( "bigint(19)" , property . GetColumnType ( ) ) ;
29+ }
30+ }
Original file line number Diff line number Diff line change 1+ namespace AppAny . Quartz . EntityFrameworkCore . Migrations . PostgreSQL . Tests ;
2+
3+ using AppAny . Quartz . EntityFrameworkCore . Migrations ;
4+ using Microsoft . EntityFrameworkCore ;
5+ using Microsoft . EntityFrameworkCore . Metadata ;
6+
7+ public class QuartzTriggerModelMappingTests
8+ {
9+ [ Fact ]
10+ public void ShouldMapMisfireOriginalFireTimeColumn ( )
11+ {
12+ var options = new DbContextOptionsBuilder < PostgreSqlIntegrationDbContext > ( )
13+ . UseNpgsql ( "Host=localhost;Port=5432;Database=quartz_mapping_tests;Username=postgres;Password=postgres" )
14+ . Options ;
15+
16+ using var dbContext = new PostgreSqlIntegrationDbContext ( options ) ;
17+ var entityType = dbContext . Model . FindEntityType ( typeof ( QuartzTrigger ) ) ;
18+
19+ Assert . NotNull ( entityType ) ;
20+
21+ var property = entityType ! . FindProperty ( nameof ( QuartzTrigger . MisfireOriginalFireTime ) ) ;
22+ Assert . NotNull ( property ) ;
23+
24+ var table = StoreObjectIdentifier . Table ( entityType . GetTableName ( ) ! , entityType . GetSchema ( ) ) ;
25+ Assert . Equal ( "misfire_orig_fire_time" , property ! . GetColumnName ( table ) ) ;
26+ Assert . Equal ( "bigint" , property . GetColumnType ( ) ) ;
27+ }
28+ }
Original file line number Diff line number Diff line change 1+ namespace AppAny . Quartz . EntityFrameworkCore . Migrations . SQLite . Tests ;
2+
3+ using AppAny . Quartz . EntityFrameworkCore . Migrations ;
4+ using Microsoft . Data . Sqlite ;
5+ using Microsoft . EntityFrameworkCore ;
6+ using Microsoft . EntityFrameworkCore . Metadata ;
7+
8+ public class QuartzTriggerModelMappingTests
9+ {
10+ [ Fact ]
11+ public void ShouldMapMisfireOriginalFireTimeColumn ( )
12+ {
13+ var connectionString = new SqliteConnectionStringBuilder
14+ {
15+ Mode = SqliteOpenMode . Memory ,
16+ DataSource = ":memory:"
17+ } . ToString ( ) ;
18+
19+ var options = new DbContextOptionsBuilder < SQLiteIntegrationDbContext > ( )
20+ . UseSqlite ( connectionString )
21+ . Options ;
22+
23+ using var dbContext = new SQLiteIntegrationDbContext ( options ) ;
24+ var entityType = dbContext . Model . FindEntityType ( typeof ( QuartzTrigger ) ) ;
25+
26+ Assert . NotNull ( entityType ) ;
27+
28+ var property = entityType ! . FindProperty ( nameof ( QuartzTrigger . MisfireOriginalFireTime ) ) ;
29+ Assert . NotNull ( property ) ;
30+
31+ var table = StoreObjectIdentifier . Table ( entityType . GetTableName ( ) ! , entityType . GetSchema ( ) ) ;
32+ Assert . Equal ( "MISFIRE_ORIG_FIRE_TIME" , property ! . GetColumnName ( table ) ) ;
33+ Assert . Equal ( "bigint" , property . GetColumnType ( ) ) ;
34+ }
35+ }
Original file line number Diff line number Diff line change 1+ namespace AppAny . Quartz . EntityFrameworkCore . Migrations . SqlServer . Tests ;
2+
3+ using AppAny . Quartz . EntityFrameworkCore . Migrations ;
4+ using Microsoft . EntityFrameworkCore ;
5+ using Microsoft . EntityFrameworkCore . Metadata ;
6+
7+ public class QuartzTriggerModelMappingTests
8+ {
9+ [ Fact ]
10+ public void ShouldMapMisfireOriginalFireTimeColumn ( )
11+ {
12+ var options = new DbContextOptionsBuilder < SqlServerIntegrationDbContext > ( )
13+ . UseSqlServer ( "Server=(localdb)\\ mssqllocaldb;Database=QuartzMappingTests;Trusted_Connection=True;" )
14+ . Options ;
15+
16+ using var dbContext = new SqlServerIntegrationDbContext ( options ) ;
17+ var entityType = dbContext . Model . FindEntityType ( typeof ( QuartzTrigger ) ) ;
18+
19+ Assert . NotNull ( entityType ) ;
20+
21+ var property = entityType ! . FindProperty ( nameof ( QuartzTrigger . MisfireOriginalFireTime ) ) ;
22+ Assert . NotNull ( property ) ;
23+
24+ var table = StoreObjectIdentifier . Table ( entityType . GetTableName ( ) ! , entityType . GetSchema ( ) ) ;
25+ Assert . Equal ( "MISFIRE_ORIG_FIRE_TIME" , property ! . GetColumnName ( table ) ) ;
26+ Assert . Equal ( "bigint" , property . GetColumnType ( ) ) ;
27+ }
28+ }
You can’t perform that action at this time.
0 commit comments