Skip to content

Commit

Permalink
Merge branch 'develop' into ym@system_catalogues
Browse files Browse the repository at this point in the history
  • Loading branch information
ymeister authored Oct 5, 2023
2 parents 26b8fd1 + 5bd03ad commit 052388a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Revision history for beam-automigrate

## Unreleased

* Add ltree column type

## 0.1.4.0

* [#52](https://github.com/obsidiansystems/beam-automigrate/pull/52) Support sql arrays
Expand Down
2 changes: 2 additions & 0 deletions src/Database/Beam/AutoMigrate.hs
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,8 @@ renderDataType = \case
PgSpecificType (PgEnumeration (EnumerationName ty)) -> ty
-- oid
PgSpecificType PgOid -> "oid"
-- ltree
PgSpecificType PgLTree -> "ltree"
-- Arrays
SqlArrayType (SqlArrayType _ _) _ -> error "beam-automigrate: invalid nested array."
SqlArrayType _ 0 -> error "beam-automigrate: array with zero dimensions"
Expand Down
2 changes: 2 additions & 0 deletions src/Database/Beam/AutoMigrate/Postgres.hs
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,8 @@ pgTypeToColumnType oid width
Just (PgSpecificType PgUuid)
| Pg.typoid Pg.oid == oid =
Just (PgSpecificType PgOid)
| Pg.Oid 16385 == oid =
Just (PgSpecificType PgLTree)
| otherwise =
Nothing

Expand Down
1 change: 1 addition & 0 deletions src/Database/Beam/AutoMigrate/Types.hs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ data PgDataType
| PgUuid
| PgEnumeration EnumerationName
| PgOid
| PgLTree

deriving instance Show PgDataType

Expand Down

0 comments on commit 052388a

Please sign in to comment.