@@ -461,7 +461,6 @@ class FluentPostgreSQLTests: XCTestCase {
461
461
462
462
// https://github.com/vapor/fluent-postgresql/issues/85
463
463
func testGH85( ) throws {
464
- /// The Exact enum from my project
465
464
enum Availability : UInt8 , PostgreSQLRawEnum {
466
465
static var allCases : [ Availability ] = [ . everyday, . sunday, . monday, . tuesday, . wednesday, . thursday, . friday, . saturday]
467
466
@@ -474,7 +473,7 @@ class FluentPostgreSQLTests: XCTestCase {
474
473
case friday
475
474
case saturday
476
475
}
477
-
476
+
478
477
struct Foo : PostgreSQLModel , Migration {
479
478
var id : Int ?
480
479
var availability : Availability
@@ -491,6 +490,24 @@ class FluentPostgreSQLTests: XCTestCase {
491
490
_ = try a. save ( on: conn) . wait ( )
492
491
}
493
492
493
+ // https://github.com/vapor/fluent-postgresql/issues/35
494
+ func testGH35( ) throws {
495
+ struct Game : PostgreSQLModel , Migration {
496
+ var id : Int ?
497
+ var tags : [ Int64 ] ?
498
+ }
499
+
500
+ let conn = try benchmarker. pool. requestConnection ( ) . wait ( )
501
+ conn. logger = DatabaseLogger ( database: . psql, handler: PrintLogHandler ( ) )
502
+ defer { benchmarker. pool. releaseConnection ( conn) }
503
+
504
+ try Game . prepare ( on: conn) . wait ( )
505
+ defer { try ? Game . revert ( on: conn) . wait ( ) }
506
+
507
+ var a = Game ( id: nil , tags: [ 1 , 2 , 3 ] )
508
+ a = try a. save ( on: conn) . wait ( )
509
+ }
510
+
494
511
static let allTests = [
495
512
( " testBenchmark " , testBenchmark) ,
496
513
( " testNestedStruct " , testNestedStruct) ,
@@ -508,6 +525,7 @@ class FluentPostgreSQLTests: XCTestCase {
508
525
( " testCreateOrUpdate " , testCreateOrUpdate) ,
509
526
( " testEnumArray " , testEnumArray) ,
510
527
( " testGH85 " , testGH85) ,
528
+ ( " testGH35 " , testGH35) ,
511
529
]
512
530
}
513
531
0 commit comments