mattes / migrate

Database migrations. CLI and Golang library.
Other
2.29k stars 326 forks source link

Added support for Redshift. #222

Closed watersofoblivion closed 7 years ago

watersofoblivion commented 7 years ago

While Redshift is wire compatible with PostgreSQL, they support different functionality internally. Due to its distributed nature and being an OLAP database instead of a OLTP, Redshift does not in general support locking.

The upgraded PostgreSQL driver uses pg_try_advisory_lock in the Lock() and Unlock() functions, which is not supported by Redshift and causes and error. This adds a Redshift-specific driver that wraps the standard PostgreSQL driver and overrides the Lock() and Unlock() to simply return nil.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 53.738% when pulling 91ecd3cb6aef269a0c13fcc5e4ae808d2879e753 on OrbotixInc:master into 448a36c5cbdcc34f348f605a5080b23629c7fbbc on mattes:master.

coveralls commented 7 years ago

Coverage Status

Coverage remained the same at 53.738% when pulling 91ecd3cb6aef269a0c13fcc5e4ae808d2879e753 on OrbotixInc:master into 448a36c5cbdcc34f348f605a5080b23629c7fbbc on mattes:master.

mattes commented 7 years ago

this is great! thank you!