@@ -36,9 +36,9 @@ let
3636 { name = "make users table"
3737 , up = void . define $
3838 createTable #users
39− ( serial `As` #id :*
40− (text & notNullable) `As` #name :* Nil )
41− ( primaryKey #id `As` #pk_users :* Nil )
39+ ( serial `as` #id :*
40+ (text & notNullable) `as` #name )
41+ ( primaryKey #id `as` #pk_users )
4242 , down = void . define $ dropTable #users
4343 }
4444:}
@@ -51,12 +51,12 @@ let
5151 { name = "make emails table"
5252 , up = void . define $
5353 createTable #emails
54− ( serial `As` #id :*
55− (int & notNullable) `As` #user_id :*
56− (text & nullable) `As` #email :* Nil )
57− ( primaryKey #id `As` #pk_emails :*
54+ ( serial `as` #id :*
55+ (int & notNullable) `as` #user_id :*
56+ (text & nullable) `as` #email )
57+ ( primaryKey #id `as` #pk_emails :*
5858 foreignKey #user_id #users #id
59− OnDeleteCascade OnUpdateCascade `As` #fk_user_id :* Nil )
59+ OnDeleteCascade OnUpdateCascade `as` #fk_user_id )
6060 , down = void . define $ dropTable #emails
6161 }
6262:}
@@ -71,7 +71,7 @@ let
7171 :: Has "schema_migrations" schema ('Table MigrationsTable)
7272 => PQ schema schema IO ()
7373 numMigrations = do
74− result <- runQuery (selectStar (from (table (#schema_migrations `As` #m))))
74+ result <- runQuery (selectStar (from (table (#schema_migrations `as` #m))))
7575 num <- ntuples result
7676 liftBase $ print num
7777:}
@@ -285,18 +285,18 @@ createMigrations
285285 => Definition schema schema
286286createMigrations =
287287 createTableIfNotExists #schema_migrations
288− ( (text & notNullable) `As` #name :*
288+ ( (text & notNullable) `as` #name :*
289289 (timestampWithTimeZone & notNullable & default_ currentTimestamp)
290− `As` #executed_at :* Nil )
291− ( unique (#name :* Nil) `As` #migrations_unique_name :* Nil )
290+ `as` #executed_at )
291+ ( unique #name `as` #migrations_unique_name )
292292
293293-- | Inserts a `Migration` into the `MigrationsTable`
294294insertMigration
295295 :: Has "schema_migrations" schema ('Table MigrationsTable)
296296 => Manipulation schema '[ 'NotNull 'PGtext] '[]
297297insertMigration = insertRow_ #schema_migrations
298− ( Set (param @1) `As` #name :*
299− Default `As` #executed_at :* Nil )
298+ ( Set (param @1) `as` #name :*
299+ Default `as` #executed_at )
300300
301301-- | Deletes a `Migration` from the `MigrationsTable`
302302deleteMigration
@@ -311,6 +311,6 @@ selectMigration
311311 => Query schema '[ 'NotNull 'PGtext ]
312312 '[ "executed_at" ::: 'NotNull 'PGtimestamptz ]
313313selectMigration = select
314− (#executed_at `As` #executed_at :* Nil)
315− ( from (table (#schema_migrations `As` #m))
314+ (#executed_at `as` #executed_at)
315+ ( from (table (#schema_migrations `as` #m))
316316 & where_ (#name .== param @1))