Skip to content

Commit 32209fe

Browse files
authored
Merge pull request #62 from obsidiansystems/ym/pre-post-hooks
Update 'cg/pre-post-hooks'
2 parents 614c0dc + 75b5de6 commit 32209fe

3 files changed

Lines changed: 13 additions & 7 deletions

File tree

.github/workflows/haskell.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
build:
77
strategy:
88
matrix:
9-
ghc: ['8.6.5', '8.8.4', '8.10.7']
9+
ghc: ['8.10.7']
1010
os: ['ubuntu-latest', 'macos-latest']
1111
runs-on: ${{ matrix.os }}
1212

@@ -17,7 +17,7 @@ jobs:
1717
with:
1818
ghc-version: ${{ matrix.ghc }}
1919
- name: Cache
20-
uses: actions/cache@v1
20+
uses: actions/cache@v4
2121
env:
2222
cache-name: cache-cabal
2323
with:
@@ -31,15 +31,15 @@ jobs:
3131
- name: install postgres (linux)
3232
run: |
3333
sudo apt-get update
34-
sudo apt-get install postgresql-14
35-
export PATH=$PATH:/usr/lib/postgresql/14/bin
34+
sudo apt-get install postgresql-16
35+
export PATH=$PATH:/usr/lib/postgresql/16/bin
3636
which pg_ctl
37-
echo "/usr/lib/postgresql/14/bin" >> $GITHUB_PATH
37+
echo "/usr/lib/postgresql/16/bin" >> $GITHUB_PATH
3838
if: matrix.os == 'ubuntu-latest'
3939
- name: install postgres (macos)
4040
run: |
4141
brew update
42-
brew install postgresql@14
42+
brew install postgresql
4343
export PATH=$PATH:`brew --prefix`/bin
4444
which pg_ctl
4545
echo "$(brew --prefix)/bin" >> $GITHUB_PATH

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
* Many instances of database entities being dropped and recreated instead of altered are now supported.
1414
* [#47](https://github.com/obsidiansystems/beam-automigrate/pull/47): Generate postgres enum types in schema when using `Nullable PgEnum` values.
1515

16+
## 0.1.7.0
17+
18+
* beam-automigrate will now only manage sequences within the search path, just as it only manages such tables.
19+
1620
## 0.1.6.0
1721

1822
* Fix instance HasSchemaConstraints build failure with GHC 9.2.8

src/Database/Beam/AutoMigrate/Postgres.hs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ sequencesQ = fromString $ unlines
168168
, " AND attrib.attrelid = dep.refobjid )"
169169
, " ) AS subselect"
170170
, " ON ( seqclass.relfilenode = subselect.dep_objid )"
171-
, "WHERE seqclass.relkind = 'S'"
171+
, "JOIN pg_catalog.pg_namespace ns ON (ns.oid = seqclass.relnamespace)"
172+
, "WHERE seqclass.relkind = 'S'"
173+
, " AND nspname = any (current_schemas(false))"
172174
]
173175

174176

0 commit comments

Comments
 (0)