@@ -461,7 +461,6 @@ class FluentPostgreSQLTests: XCTestCase {
461461
462462 // https://github.com/vapor/fluent-postgresql/issues/85
463463 func testGH85( ) throws {
464- /// The Exact enum from my project
465464 enum Availability : UInt8 , PostgreSQLRawEnum {
466465 static var allCases : [ Availability ] = [ . everyday, . sunday, . monday, . tuesday, . wednesday, . thursday, . friday, . saturday]
467466
@@ -474,7 +473,7 @@ class FluentPostgreSQLTests: XCTestCase {
474473 case friday
475474 case saturday
476475 }
477-
476+ 478477 struct Foo : PostgreSQLModel , Migration {
479478 var id : Int ?
480479 var availability : Availability
@@ -491,6 +490,24 @@ class FluentPostgreSQLTests: XCTestCase {
491490 _ = try a. save ( on: conn) . wait ( )
492491 }
493492
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+ 494511 static let allTests = [
495512 ( " testBenchmark " , testBenchmark) ,
496513 ( " testNestedStruct " , testNestedStruct) ,
@@ -508,6 +525,7 @@ class FluentPostgreSQLTests: XCTestCase {
508525 ( " testCreateOrUpdate " , testCreateOrUpdate) ,
509526 ( " testEnumArray " , testEnumArray) ,
510527 ( " testGH85 " , testGH85) ,
528+ ( " testGH35 " , testGH35) ,
511529 ]
512530}
513531
0 commit comments