-
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 #222 from nathan-c/master
Add MS SQL Server Support
- Loading branch information
Showing
24 changed files
with
627 additions
and
4 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 |
---|---|---|
|
@@ -4,4 +4,5 @@ cli/cli | |
cli/migrate | ||
.coverage | ||
.godoc.pid | ||
vendor/ | ||
vendor/ | ||
.vscode/ |
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
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
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
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,21 @@ | ||
# Microsoft SQL Server | ||
|
||
`sqlserver://username:password@host/instance?param1=value¶m2=value` | ||
`sqlserver://username:password@host:port?param1=value¶m2=value` | ||
|
||
| URL Query | WithInstance Config | Description | | ||
|------------|---------------------|-------------| | ||
| `x-migrations-table` | `MigrationsTable` | Name of the migrations table | | ||
| `username` | | enter the SQL Server Authentication user id or the Windows Authentication user id in the DOMAIN\User format. On Windows, if user id is empty or missing Single-Sign-On is used. | | ||
| `password` | | The user's password. | | ||
| `host` | | The host to connect to. | | ||
| `port` | | The port to connect to. | | ||
| `instance` | | SQL Server instance name. | | ||
| `database` | `DatabaseName` | The name of the database to connect to | | ||
| `connection+timeout` | | in seconds (default is 0 for no timeout), set to 0 for no timeout. | | ||
| `dial+timeout` | | in seconds (default is 15), set to 0 for no timeout. | | ||
| `encrypt` | | `disable` - Data send between client and server is not encrypted. `false` - Data sent between client and server is not encrypted beyond the login packet (Default). `true` - Data sent between client and server is encrypted. | | ||
| `app+name` || The application name (default is go-mssqldb). | | ||
|
||
See https://github.com/denisenkom/go-mssqldb for full parameter list. | ||
|
1 change: 1 addition & 0 deletions
1
database/mssql/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/mssql/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/mssql/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/mssql/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 city varchar(100); | ||
|
||
|
1 change: 1 addition & 0 deletions
1
database/mssql/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/mssql/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 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/mssql/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/mssql/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/mssql/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/mssql/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/mssql/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/mssql/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/mssql/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/mssql/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.