#Are there any postgres migration libs that work on pages?

9 messages · Page 1 of 1 (latest)

tawdry wren
#

I use drizzle as an orm and it has a postgres-js adapter which works fine. but when I try to apply migrations using that adapter, cloudflare throws build errors because the migration client uses node:fs, which isnt supported on pages.

Are there any alternative ways to apply sql migration files to my postgres database?

lyric halo
#

do you have node compat enabled

#

alternative ways:

  1. manually run migrations
  2. run migrations in CI
tawdry wren
# lyric halo do you have node compat enabled

Yes, I have the nodejs_compat flag in the pages settings. Currently I just manually run the migrations through the connection string with my client. Exploring alternative migration tools that could hopefully automate this though.

lyric halo
#

ohh, I know why when I think about it

#

workers are just one .js file, and run in a context without a filesystem

#

so no fs api is integrated (other than workers sites/adding them at build time)

#

I'd go with a ci pipeline that runs them

#

for me, doing it manually isn't that big of a chore — you only need migrations when you change the schema