@@ -36,9 +36,9 @@ let
36 { name = "make users table"
36 { name = "make users table"
37 , up = void . define $
37 , up = void . define $
38 createTable #users
38 createTable #users
39− ( serial `As` #id :*
39+ ( serial `as` #id :*
40− (text & notNullable) `As` #name :* Nil )
40+ (text & notNullable) `as` #name )
41− ( primaryKey #id `As` #pk_users :* Nil )
41+ ( primaryKey #id `as` #pk_users )
42 , down = void . define $ dropTable #users
42 , down = void . define $ dropTable #users
@@ -51,12 +51,12 @@ let
51 { name = "make emails table"
51 { name = "make emails table"
52 , up = void . define $
52 , up = void . define $
53 createTable #emails
53 createTable #emails
54− ( serial `As` #id :*
54+ ( serial `as` #id :*
55− (int & notNullable) `As` #user_id :*
55+ (int & notNullable) `as` #user_id :*
56− (text & nullable) `As` #email :* Nil )
56+ (text & nullable) `as` #email )
57− ( primaryKey #id `As` #pk_emails :*
57+ ( primaryKey #id `as` #pk_emails :*
58 foreignKey #user_id #users #id
58 foreignKey #user_id #users #id
59− OnDeleteCascade OnUpdateCascade `As` #fk_user_id :* Nil )
59+ OnDeleteCascade OnUpdateCascade `as` #fk_user_id )
60 , down = void . define $ dropTable #emails
60 , down = void . define $ dropTable #emails
@@ -71,7 +71,7 @@ let
71 :: Has "schema_migrations" schema ('Table MigrationsTable)
71 :: Has "schema_migrations" schema ('Table MigrationsTable)
72 => PQ schema schema IO ()
72 => PQ schema schema IO ()
73 numMigrations = do
73 numMigrations = do
74− result <- runQuery (selectStar (from (table (#schema_migrations `As` #m))))
74+ result <- runQuery (selectStar (from (table (#schema_migrations `as` #m))))
75 num <- ntuples result
75 num <- ntuples result
76 liftBase $ print num
76 liftBase $ print num
@@ -285,18 +285,18 @@ createMigrations
285 => Definition schema schema
285 => Definition schema schema
286createMigrations =
286createMigrations =
287 createTableIfNotExists #schema_migrations
287 createTableIfNotExists #schema_migrations
288− ( (text & notNullable) `As` #name :*
288+ ( (text & notNullable) `as` #name :*
289 (timestampWithTimeZone & notNullable & default_ currentTimestamp)
289 (timestampWithTimeZone & notNullable & default_ currentTimestamp)
290− `As` #executed_at :* Nil )
290+ `as` #executed_at )
291− ( unique (#name :* Nil) `As` #migrations_unique_name :* Nil )
291+ ( unique #name `as` #migrations_unique_name )
293-- | Inserts a `Migration` into the `MigrationsTable`
293-- | Inserts a `Migration` into the `MigrationsTable`
294insertMigration
294insertMigration
295 :: Has "schema_migrations" schema ('Table MigrationsTable)
295 :: Has "schema_migrations" schema ('Table MigrationsTable)
296 => Manipulation schema '[ 'NotNull 'PGtext] '[]
296 => Manipulation schema '[ 'NotNull 'PGtext] '[]
297insertMigration = insertRow_ #schema_migrations
297insertMigration = insertRow_ #schema_migrations
298− ( Set (param @1) `As` #name :*
298+ ( Set (param @1) `as` #name :*
299− Default `As` #executed_at :* Nil )
299+ Default `as` #executed_at )
301-- | Deletes a `Migration` from the `MigrationsTable`
301-- | Deletes a `Migration` from the `MigrationsTable`
302deleteMigration
302deleteMigration
@@ -311,6 +311,6 @@ selectMigration
311 => Query schema '[ 'NotNull 'PGtext ]
311 => Query schema '[ 'NotNull 'PGtext ]
312 '[ "executed_at" ::: 'NotNull 'PGtimestamptz ]
312 '[ "executed_at" ::: 'NotNull 'PGtimestamptz ]
313selectMigration = select
313selectMigration = select
314− (#executed_at `As` #executed_at :* Nil)
314+ (#executed_at `as` #executed_at)
315− ( from (table (#schema_migrations `As` #m))
315+ ( from (table (#schema_migrations `as` #m))
316 & where_ (#name .== param @1))
316 & where_ (#name .== param @1))