node-pg-migrate
node-pg-migrate copied to clipboard
Support for AWS Redshift
Does this package support AWS Redshift? Since Redshift is based on PostgreSQL, I'm hoping it'll just work? I've been trying it out but getting connection timeout issues, not sure if this is due to bad config on AWS or lack of support for Redshift?
AFAIK this project uses pg under the hood
https://github.com/salsita/node-pg-migrate/blob/db3f9012374aa0917f408d12be91f5932ca336b1/package.json#L93
https://github.com/salsita/node-pg-migrate/blob/db3f9012374aa0917f408d12be91f5932ca336b1/src/db.ts#L32-L43
Yes, I know, that's why I'm thinking it should be compatible. I suspect there's simply something off in my AWS config, and I'll be working on that today, but I just wanted to make sure from the "source" that it should be compatible.
I got the AWS config sorted out and was able to reach the Redshift DB, but I encountered to following error, which I assume means that this package isn't compatible with Redshift afterall.
Error executing:
CREATE TABLE "public"."pgmigrations" ( id SERIAL PRIMARY KEY, name varchar(255) NOT NULL, run_on timestamp NOT NULL)
error: Column "pgmigrations.id" has unsupported type "serial".
Error executing:
select pg_advisory_unlock(7241865325823964) as "lockReleased"
error: function pg_advisory_unlock(bigint) does not exist
function pg_advisory_unlock(bigint) does not exist
Error: Unable to ensure migrations table: error: Column "pgmigrations.id" has unsupported type "serial".
Feel free to close this issue if there's nothing more to say here!?
@goce-cz Could you have a look into that and triage it? If there is nothing we can to support it, you should close the issue. Otherwise let's discuss and think about it.
hello, sorry for such a long time to answer.
yes we using serial for the table id in the migrations table... could we use smth else then unsupported types, for example, basic integer or smth. probably...
@andre-engelbrecht I believe, one way to overcome it, is to create the table for migrations manually prior and provide it's name to node-pg-migration (see https://salsita.github.io/node-pg-migrate/#/cli?id=configuration - migrationTable option) or use the default name pgmigrations
.
node-pg-migrate will check if the table exists and have primary key constraint on id but that's about it.
see also https://github.com/salsita/node-pg-migrate/pull/766, maybe you gonna get new errors
I ended up just manually handling migrations for now. I bit of manually effort, but our Redshift DB is pretty static. Thanks for the feedback though.