on dev help sign in
Merge branch 'dev-if-not-exists' into dev
commit0c1d0356f0143c589510d32676fb2547d78a7f40 authorEitan Chatav <eitan@EEM109LMBP-1.local> dateFri 27 Sep 2019, 09:18 (7 years ago) parent64d641a901ff7b
1 file changed+9−9
squeal-postgresql/src/Squeal/PostgreSQL/Definition/Table.hs+9−9
squeal-postgresql/src/Squeal/PostgreSQL/Definition/Table.hs+9−9
@@ -195,9 +195,9 @@ dropTable tab = UnsafeDefinition $ "DROP TABLE" <+> renderSQL tab <> ";"
195195
196196dropTableIfExists
197197 :: ( Has sch schemas schema
198− , Has tab schema ('Table table))
198+ , KnownSymbol tab)
199199 => QualifiedAlias sch tab -- ^ table to remove
200− -> Definition schemas (Alter sch (DropIfExists tab schema) schemas)
200+ -> Definition schemas (Alter sch (DropSchemumIfExists tab 'Table schema) schemas)
201201dropTableIfExists tab = UnsafeDefinition $ "DROP TABLE IF EXISTS" <+> renderSQL tab <> ";"
202202
203203-- | `alterTable` changes the definition of a table from the schema.
@@ -217,13 +217,13 @@ alterTable tab alteration = UnsafeDefinition $
217217-- >>> printSQL $ alterTableRename #foo #bar
218218-- ALTER TABLE "foo" RENAME TO "bar";
219219alterTableRename
220− :: (KnownSymbol table0, KnownSymbol table1)
221− => Alias table0 -- ^ table to rename
222− -> Alias table1 -- ^ what to rename it
223− -> Definition schema (Rename table0 table1 schema)
224−alterTableRename table0 table1 = UnsafeDefinition $
225− "ALTER TABLE" <+> renderSQL table0
226− <+> "RENAME TO" <+> renderSQL table1 <> ";"
220+ :: (KnownSymbol tab0, KnownSymbol tab1)
221+ => Alias tab0 -- ^ table to rename
222+ -> Alias tab1 -- ^ what to rename it
223+ -> Definition schema (Rename tab0 tab1 schema)
224+alterTableRename tab0 tab1 = UnsafeDefinition $
225+ "ALTER TABLE" <+> renderSQL tab0
226+ <+> "RENAME TO" <+> renderSQL tab1 <> ";"
227227
228228-- | An `AlterTable` describes the alteration to perform on the columns
229229-- of a table.