Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
63d9cd5
commit ec82793
Showing
5 changed files
with
113 additions
and
14 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,4 +1,5 @@ | ||
.bundle | ||
db/*.sqlite3 | ||
db/*structure.sql | ||
log/*.log | ||
tmp/ |
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 |
---|---|---|
@@ -1,2 +1,31 @@ | ||
#!/usr/bin/env ruby | ||
# | ||
# A sqlcmd bin replacement for unix platforms for use by the Rails | ||
# db:test:clone_structure rake task for the ActiveRecord SQL Server adapter. | ||
# | ||
# Make sure you have ssh access to your Windows box using the host | ||
# name in your database.yml. If your windows ssh username is different | ||
# than your unix username, setup a ~/.ssh/conf entry that fills in the | ||
# details. | ||
# | ||
|
||
args = ARGV.dup | ||
|
||
host_index = args.index('-S') + 1 | ||
host = args[host_index].dup | ||
args[host_index] = 'localhost' | ||
|
||
if file_index = args.index('-i') | ||
findex = file_index + 1 | ||
args[findex] = args[findex].gsub /\\/, '/' | ||
end | ||
|
||
if query_index = args.index('-Q') | ||
qindex = query_index + 1 | ||
args[qindex] = "\\\"#{args[qindex]}\\\"" | ||
end | ||
|
||
cmd = args.join(' ') | ||
|
||
`ssh #{host} \"sqlcmd #{cmd}\"` | ||
|
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