@@ -2325,102 +2325,6 @@ nullsNotDistinctTests connSource = do
23252325 ]
23262326 }
23272327
2328- reservedWordColumnTests :: ConnectionSourceM (LogT IO ) -> TestTree
2329- reservedWordColumnTests connSource =
2330- testCaseSteps' " Reserved word column tests" connSource $ \ step -> do
2331- freshTestDB step
2332-
2333- step " Create a table with a plain index on a 'timestamp' column"
2334- assertNoException " Table with index on 'timestamp' column should be created successfully" $ do
2335- let definitions = tableDefsWithPgCrypto [tableWithTimestampIndex]
2336- migrateDatabase
2337- defaultExtrasOptions
2338- definitions
2339- [createTableMigration tableWithTimestampIndex]
2340- checkDatabase defaultExtrasOptions definitions
2341-
2342- freshTestDB step
2343-
2344- step " Create a table with a unique index on a 'timestamp' column"
2345- assertNoException " Table with unique index on 'timestamp' column should be created successfully" $ do
2346- let definitions = tableDefsWithPgCrypto [tableWithUniqueTimestampIndex]
2347- migrateDatabase
2348- defaultExtrasOptions
2349- definitions
2350- [createTableMigration tableWithUniqueTimestampIndex]
2351- checkDatabase defaultExtrasOptions definitions
2352-
2353- freshTestDB step
2354-
2355- step " Create a table with a composite index including a 'timestamp' column"
2356- assertNoException " Table with composite index on 'timestamp' column should be created successfully" $ do
2357- let definitions = tableDefsWithPgCrypto [tableWithCompositeTimestampIndex]
2358- migrateDatabase
2359- defaultExtrasOptions
2360- definitions
2361- [createTableMigration tableWithCompositeTimestampIndex]
2362- checkDatabase defaultExtrasOptions definitions
2363-
2364- freshTestDB step
2365-
2366- step " Attempt to create a table with an index on a 'select' column"
2367- assertException " Table with index on 'select' column can't be created" $ do
2368- let definitions = tableDefsWithPgCrypto [tableWithSelectIndex]
2369- migrateDatabase
2370- defaultExtrasOptions
2371- definitions
2372- [createTableMigration tableWithSelectIndex]
2373- checkDatabase defaultExtrasOptions definitions
2374- where
2375- tableWithTimestampIndex =
2376- tblTable
2377- { tblName = " reserved_word_test1"
2378- , tblVersion = 1
2379- , tblColumns =
2380- [ tblColumn {colName = " id" , colType = UuidT , colNullable = False , colDefault = Just " gen_random_uuid()" }
2381- , tblColumn {colName = " timestamp" , colType = TimestampWithZoneT , colNullable = False }
2382- ]
2383- , tblPrimaryKey = pkOnColumn " id"
2384- , tblIndexes = [indexOnColumn " timestamp" ]
2385- }
2386-
2387- tableWithUniqueTimestampIndex =
2388- tblTable
2389- { tblName = " reserved_word_test2"
2390- , tblVersion = 1
2391- , tblColumns =
2392- [ tblColumn {colName = " id" , colType = UuidT , colNullable = False , colDefault = Just " gen_random_uuid()" }
2393- , tblColumn {colName = " timestamp" , colType = TimestampWithZoneT , colNullable = False }
2394- ]
2395- , tblPrimaryKey = pkOnColumn " id"
2396- , tblIndexes = [uniqueIndexOnColumn " timestamp" ]
2397- }
2398-
2399- tableWithCompositeTimestampIndex =
2400- tblTable
2401- { tblName = " reserved_word_test3"
2402- , tblVersion = 1
2403- , tblColumns =
2404- [ tblColumn {colName = " id" , colType = UuidT , colNullable = False , colDefault = Just " gen_random_uuid()" }
2405- , tblColumn {colName = " timestamp" , colType = TimestampWithZoneT , colNullable = False }
2406- , tblColumn {colName = " name" , colType = TextT , colNullable = True }
2407- ]
2408- , tblPrimaryKey = pkOnColumn " id"
2409- , tblIndexes = [indexOnColumns [indexColumn " timestamp" , indexColumn " name" ]]
2410- }
2411-
2412- tableWithSelectIndex =
2413- tblTable
2414- { tblName = " reserved_word_test4"
2415- , tblVersion = 1
2416- , tblColumns =
2417- [ tblColumn {colName = " id" , colType = UuidT , colNullable = False , colDefault = Just " gen_random_uuid()" }
2418- , tblColumn {colName = " select" , colType = TextT , colNullable = True }
2419- ]
2420- , tblPrimaryKey = pkOnColumn " id"
2421- , tblIndexes = [indexOnColumn " select" ]
2422- }
2423-
24242328sqlAnyAllTests :: TestTree
24252329sqlAnyAllTests =
24262330 testGroup
@@ -2720,7 +2624,6 @@ main = do
27202624 , foreignKeyIndexesTests connSource
27212625 , overlapingIndexesTests connSource
27222626 , nullsNotDistinctTests connSource
2723- , reservedWordColumnTests connSource
27242627 , sqlAnyAllTests
27252628 , enumTest connSource
27262629 , numericColumnTypeTest connSource
0 commit comments