-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #128 from andrei-m/fix-redshift
Fix Redshift migrations driver
- Loading branch information
Showing
17 changed files
with
637 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,21 @@ | ||
Redshift | ||
=== | ||
# Redshift | ||
|
||
This provides a Redshift driver for migrations. It is used whenever the URL of the database starts with `redshift://`. | ||
`redshift://user:password@host:port/dbname?query` | ||
|
||
| URL Query | WithInstance Config | Description | | ||
|------------|---------------------|-------------| | ||
| `x-migrations-table` | `MigrationsTable` | Name of the migrations table | | ||
| `dbname` | `DatabaseName` | The name of the database to connect to | | ||
| `search_path` | | This variable specifies the order in which schemas are searched when an object is referenced by a simple name with no schema specified. | | ||
| `user` | | The user to sign in as | | ||
| `password` | | The user's password | | ||
| `host` | | The host to connect to. Values that start with / are for unix domain sockets. (default is localhost) | | ||
| `port` | | The port to bind to. (default is 5439) | | ||
| `fallback_application_name` | | An application_name to fall back to if one isn't provided. | | ||
| `connect_timeout` | | Maximum wait for connection, in seconds. Zero or not specified means wait indefinitely. | | ||
| `sslcert` | | Cert file location. The file must contain PEM encoded data. | | ||
| `sslkey` | | Key file location. The file must contain PEM encoded data. | | ||
| `sslrootcert` | | The location of the root certificate file. The file must contain PEM encoded data. | | ||
| `sslmode` | | Whether or not to use SSL (disable\|require\|verify-ca\|verify-full) | | ||
|
||
Redshift is PostgreSQL compatible but has some specific features (or lack thereof) that require slightly different behavior. |
1 change: 1 addition & 0 deletions
1
database/redshift/examples/migrations/1085649617_create_users_table.down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP TABLE IF EXISTS users; |
5 changes: 5 additions & 0 deletions
5
database/redshift/examples/migrations/1085649617_create_users_table.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
CREATE TABLE users ( | ||
user_id integer unique, | ||
name varchar(40), | ||
email varchar(40) | ||
); |
1 change: 1 addition & 0 deletions
1
database/redshift/examples/migrations/1185749658_add_city_to_users.down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
ALTER TABLE users DROP COLUMN IF EXISTS city; |
3 changes: 3 additions & 0 deletions
3
database/redshift/examples/migrations/1185749658_add_city_to_users.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ALTER TABLE users ADD COLUMN city varchar(100); | ||
|
||
|
1 change: 1 addition & 0 deletions
1
database/redshift/examples/migrations/1285849751_add_index_on_user_emails.down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP INDEX IF EXISTS users_email_index; |
3 changes: 3 additions & 0 deletions
3
database/redshift/examples/migrations/1285849751_add_index_on_user_emails.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
CREATE UNIQUE INDEX CONCURRENTLY users_email_index ON users (email); | ||
|
||
-- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sed interdum velit, tristique iaculis justo. Pellentesque ut porttitor dolor. Donec sit amet pharetra elit. Cras vel ligula ex. Phasellus posuere. |
1 change: 1 addition & 0 deletions
1
database/redshift/examples/migrations/1385949617_create_books_table.down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP TABLE IF EXISTS books; |
5 changes: 5 additions & 0 deletions
5
database/redshift/examples/migrations/1385949617_create_books_table.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
CREATE TABLE books ( | ||
user_id integer, | ||
name varchar(40), | ||
author varchar(40) | ||
); |
1 change: 1 addition & 0 deletions
1
database/redshift/examples/migrations/1485949617_create_movies_table.down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP TABLE IF EXISTS movies; |
5 changes: 5 additions & 0 deletions
5
database/redshift/examples/migrations/1485949617_create_movies_table.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
CREATE TABLE movies ( | ||
user_id integer, | ||
name varchar(40), | ||
director varchar(40) | ||
); |
1 change: 1 addition & 0 deletions
1
database/redshift/examples/migrations/1585849751_just_a_comment.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sed interdum velit, tristique iaculis justo. Pellentesque ut porttitor dolor. Donec sit amet pharetra elit. Cras vel ligula ex. Phasellus posuere. |
1 change: 1 addition & 0 deletions
1
database/redshift/examples/migrations/1685849751_another_comment.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sed interdum velit, tristique iaculis justo. Pellentesque ut porttitor dolor. Donec sit amet pharetra elit. Cras vel ligula ex. Phasellus posuere. |
1 change: 1 addition & 0 deletions
1
database/redshift/examples/migrations/1785849751_another_comment.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sed interdum velit, tristique iaculis justo. Pellentesque ut porttitor dolor. Donec sit amet pharetra elit. Cras vel ligula ex. Phasellus posuere. |
1 change: 1 addition & 0 deletions
1
database/redshift/examples/migrations/1885849751_another_comment.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-- Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean sed interdum velit, tristique iaculis justo. Pellentesque ut porttitor dolor. Donec sit amet pharetra elit. Cras vel ligula ex. Phasellus posuere. |
Oops, something went wrong.