on dev help sign in
fix some more tests
0073a2cEitan Chatav
squeal-postgresql/src/Squeal/PostgreSQL/Binary.hs+3−3
@@ -114,7 +114,7 @@ type Schema =
114
114
115>>> :{
115>>> :{
116let
116let
117− setup :: Definition '[] Schema
117+ setup :: Definition '["public" ::: '[]] '["public" ::: Schema]
118 setup =
118 setup =
119 createTypeEnumFrom @Schwarma #schwarma >>>
119 createTypeEnumFrom @Schwarma #schwarma >>>
120 createTypeCompositeFrom @Person #person
120 createTypeCompositeFrom @Person #person
@@ -146,7 +146,7 @@ Once again, define a round trip query.
146
146
147>>> :{
147>>> :{
148let
148let
149− roundTrip :: Query Schema (TuplePG Row) (RowPG Row)
149+ roundTrip :: Query '["public" ::: Schema] (TuplePG Row) (RowPG Row)
150 roundTrip = values_ $
150 roundTrip = values_ $
151 parameter @1 (typedef #schwarma) `as` #schwarma :*
151 parameter @1 (typedef #schwarma) `as` #schwarma :*
152 parameter @2 (typedef #person) `as` #person1 :*
152 parameter @2 (typedef #person) `as` #person1 :*
@@ -157,7 +157,7 @@ Finally, we can drop our type definitions.
157
157
158>>> :{
158>>> :{
159let
159let
160− teardown :: Definition Schema '[]
160+ teardown :: Definition '["public" ::: Schema] '["public" ::: '[]]
161 teardown = dropType #schwarma >>> dropType #person
161 teardown = dropType #schwarma >>> dropType #person
162:}
162:}
163
163
squeal-postgresql/src/Squeal/PostgreSQL/Migration.hs+1
@@ -265,6 +265,7 @@ createMigrations
265 :: Has "migrations" db MigrationsSchema
265 :: Has "migrations" db MigrationsSchema
266 => Definition db db
266 => Definition db db
267createMigrations =
267createMigrations =
268+ createSchemaIfNotExists #migrations >>>
268 createTableIfNotExists (#migrations ! #schema_migrations)
269 createTableIfNotExists (#migrations ! #schema_migrations)
269 ( (text & notNullable) `as` #name :*
270 ( (text & notNullable) `as` #name :*
270 (timestampWithTimeZone & notNullable & default_ currentTimestamp)
271 (timestampWithTimeZone & notNullable & default_ currentTimestamp)