mssql_mysql_migrator 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.travis.yml +4 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +74 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/database.yml.template +15 -0
- data/exe/mssql-mysql-migrator +268 -0
- data/lib/mssql_mysql_migrator.rb +10 -0
- data/lib/mssql_mysql_migrator/version.rb +3 -0
- data/mssql_mysql_migrator.gemspec +43 -0
- metadata +186 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 32d1282363c8a58c1af54398185cd4c3bbc5e637
|
4
|
+
data.tar.gz: 404a3977b2ce80b9ce50f7fbea739f1513c25a77
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d4afaec51d035e33bc0ef40066e4dfb020aed97856de79e47109266868cf46c869604585016b6d8cfa04dbf0e69a4386f4502f06506aa5dd2a00f2afd08b6565
|
7
|
+
data.tar.gz: 7dbf6c730601be76017850d0611719008adffa63787e9ccfc52665e8535178f8067d8a9109a1f88f86c917b59b481d0cce32790b16d5d33e55b131cd557466b5
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
+
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
|
6
|
+
|
7
|
+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
+
|
9
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
+
|
11
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
+
|
13
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 dirk lüsebrink/ART+COM AG
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Migrate Table data from MSSQL to MySQL with MssqlMysqlMigrator
|
2
|
+
|
3
|
+
This gem puts puts together my code to migrate the data from a MSSQL to a MySQL server. Its was done to move an old rails project from windows to linux.
|
4
|
+
|
5
|
+
It is NOT using Rails Active Record. This is because i want to move the data and avoid all overhead od interpreting or validating them. I consider this part of the actuall business logic. Also this frees this gem from all dependency on the actuall rails app, removing of course also the dependency on rails or any particular ruby/rails version combination.
|
6
|
+
|
7
|
+
Importing data to mysql is done via CVS file import. Again, this is for efficency reasons. Letting MySQL itself load the data from disk in bulk mode give you access to the most efficient code path there is. You simply can't load SQL data toa database faster and better than the database itself.
|
8
|
+
|
9
|
+
Most simple usage to transfer all talbles would be:
|
10
|
+
|
11
|
+
$ mssql-mysql-migrator transfer source_db destination_db
|
12
|
+
|
13
|
+
The database account are found in 'database.yml' config file. See database.yml.template (like rails, but it goes into Sequel, not ActiveRecord). Overload default config lookup with --database_config=your-config-file.yml.
|
14
|
+
|
15
|
+
Documentation for now is limited, please read the source and exploit the code for whatever usage you might have in mind. Over time, when actually demanded, documentation, and error handling for this gem might improve.
|
16
|
+
|
17
|
+
A Full blown example like my actuall data transfer would look like:
|
18
|
+
|
19
|
+
$ mssql-mysql-migrator
|
20
|
+
--loglevel=info # defines verbosity(error, warn, info, debug)
|
21
|
+
--debug # shows callstack in case of error
|
22
|
+
--outdir=$(pwd)/tmp # where to put the CSV files
|
23
|
+
--exclude-tables=schema_info,schema_migrations # not transfered
|
24
|
+
transfer ac-express-live test # source and target DB
|
25
|
+
|
26
|
+
## More usage examples
|
27
|
+
|
28
|
+
*checking the character encoding*
|
29
|
+
|
30
|
+
Character encoding, when you have to think about it, tends to easily turn into a nightmare. A triple error in an encoding chain might make it all look nice and right, when it is not. The encoding is also a parameter in the database condig file but to help you tinkering with various setting there is the encoding test where you can check multiple encoding option from the command line. See my example:
|
31
|
+
|
32
|
+
$ mssql-mysql-migrator encoding-test database:table_name:column 'id = 31' iso-8859-1,cp1252,latin1
|
33
|
+
|
34
|
+
With this command you read exactly one value from a database in all the encoding you list (comma seperated, no blanks) at the end. Easy way check what you get from you db connection depending on the encoding setting.
|
35
|
+
|
36
|
+
*list tables*
|
37
|
+
|
38
|
+
yeah, easy:
|
39
|
+
|
40
|
+
$ mssql-mysql-migrator list-tables ac-express-live
|
41
|
+
|
42
|
+
Will help you to specify which tables you actually have and need to copy.
|
43
|
+
|
44
|
+
## Installation
|
45
|
+
|
46
|
+
Add this line to your application's Gemfile:
|
47
|
+
|
48
|
+
```ruby
|
49
|
+
gem 'mssql_mysql_migrator'
|
50
|
+
```
|
51
|
+
|
52
|
+
And then execute:
|
53
|
+
|
54
|
+
$ bundle
|
55
|
+
|
56
|
+
Or install it yourself as:
|
57
|
+
|
58
|
+
$ gem install mssql_mysql_migrator
|
59
|
+
|
60
|
+
## Development
|
61
|
+
|
62
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake rspec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
63
|
+
|
64
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
65
|
+
|
66
|
+
## Contributing
|
67
|
+
|
68
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/mssql_mysql_migrator. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
69
|
+
|
70
|
+
|
71
|
+
## License
|
72
|
+
|
73
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
74
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "mssql_mysql_migrator"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
source-db:
|
2
|
+
adapter: tinytds # sqlserver
|
3
|
+
username: <user>
|
4
|
+
password: <password>
|
5
|
+
database: name_of_database
|
6
|
+
encoding: CP1252 # latin1 #utf-8 # iso-8859-1 # utf8 #
|
7
|
+
host: some.host.of.yours
|
8
|
+
|
9
|
+
destination-db:
|
10
|
+
adapter: mysql
|
11
|
+
database: name_of_database
|
12
|
+
username: <user>
|
13
|
+
password: <password>
|
14
|
+
encoding: utf8
|
15
|
+
host: localhost
|
@@ -0,0 +1,268 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler/setup'
|
5
|
+
require 'ac/logger'
|
6
|
+
require 'applix'
|
7
|
+
|
8
|
+
require 'mssql_mysql_migrator'
|
9
|
+
|
10
|
+
$log = AC::Logger[]
|
11
|
+
|
12
|
+
Defaults = {
|
13
|
+
loglevel: 'info',
|
14
|
+
database_config: 'database.yml',
|
15
|
+
}
|
16
|
+
|
17
|
+
module MssqlMysqlMigrator
|
18
|
+
|
19
|
+
class SequelDB
|
20
|
+
Defaults = {}
|
21
|
+
|
22
|
+
def initialize(params = {})
|
23
|
+
@params = Defaults.merge(params)
|
24
|
+
log = AC::Logger[]
|
25
|
+
log.level = AC::Logger::Levels['warn']
|
26
|
+
db.loggers << log
|
27
|
+
end
|
28
|
+
|
29
|
+
def table(name)
|
30
|
+
@db[name.to_sym]
|
31
|
+
end
|
32
|
+
|
33
|
+
private
|
34
|
+
|
35
|
+
def db
|
36
|
+
@db ||= Sequel.connect(@params)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
class MSSQL < SequelDB
|
41
|
+
def initialize params
|
42
|
+
super(params.merge(adapter: 'tinytds'))
|
43
|
+
end
|
44
|
+
|
45
|
+
def table_names
|
46
|
+
@table_names ||= (
|
47
|
+
ds = db['select table_name FROM INFORMATION_SCHEMA.TABLES']
|
48
|
+
ds.all.map {|e| e.values}.flatten.sort
|
49
|
+
)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
class MySQL < SequelDB
|
54
|
+
def initialize params
|
55
|
+
debugger rescue nil
|
56
|
+
super(params.merge(adapter: 'mysql'))
|
57
|
+
end
|
58
|
+
|
59
|
+
def import_table(table_name, csv_path)
|
60
|
+
sql = <<-SQL
|
61
|
+
DELETE FROM #{table_name};
|
62
|
+
LOAD DATA INFILE '#{csv_path}' INTO TABLE #{table_name}
|
63
|
+
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"'
|
64
|
+
IGNORE 1 LINES;
|
65
|
+
SHOW WARNINGS
|
66
|
+
SQL
|
67
|
+
$log.debug "running mysql import: #{sql}"
|
68
|
+
debugger rescue nil
|
69
|
+
ds = db.run(sql)
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
class Main
|
74
|
+
def initialize(config = {})
|
75
|
+
@config = Defaults.merge(config)
|
76
|
+
$log.level = AC::Logger::Levels[@config[:loglevel]]
|
77
|
+
$log.debug "settings: #{@config}"
|
78
|
+
#ActiveRecord::Base.logger = $log
|
79
|
+
[]
|
80
|
+
end
|
81
|
+
|
82
|
+
# example usage:
|
83
|
+
#
|
84
|
+
# ./exe/mssql-mysql-migrator encoding_test \
|
85
|
+
# ac-express-live:ad_locations:description 'id = 3' iso-8859-1,cp1252
|
86
|
+
#
|
87
|
+
def encoding_test(db_tab_col, cond, encodings = nil, *args)
|
88
|
+
db_name, tab_name, col_name = db_tab_col.split(':')
|
89
|
+
$log.debug "loading '#{col_name}' from '#{tab_name}' at '#{cond}'"
|
90
|
+
default_encodings = 'utf8, cp1252, iso-8859-1, latin1'
|
91
|
+
encodings = (encodings || default_encodings).split(/,\s*/)
|
92
|
+
$log.debug "testing encodings: #{encodings}"
|
93
|
+
|
94
|
+
db_conf = database_config(db_name)
|
95
|
+
encodings.each do |encoding|
|
96
|
+
db = Sequel.connect(db_conf.merge('encoding' => encoding))
|
97
|
+
s = db["select #{col_name} from #{tab_name} where #{cond}"].first[col_name.to_sym]
|
98
|
+
puts "#{encoding}: '#{s}'(#{s.length}), #{s.bytes}"
|
99
|
+
end
|
100
|
+
|
101
|
+
[]
|
102
|
+
end
|
103
|
+
|
104
|
+
# usage: ... import-table <database> <table name> <csv file>
|
105
|
+
#
|
106
|
+
# example:
|
107
|
+
#
|
108
|
+
# ... import-table test ad_locations $(pwd)/tmp/ad_locations.csv
|
109
|
+
#
|
110
|
+
def import_table(db_name, table_name, csv_path)
|
111
|
+
$log.debug "open destination datbabase(#{db_name})"
|
112
|
+
dest_db = open_destination_db(db_name)
|
113
|
+
dest_db.import_table(table_name, csv_path)
|
114
|
+
end
|
115
|
+
|
116
|
+
# usage: ... copy-table <src db> <dest db> <table name>
|
117
|
+
#
|
118
|
+
# example:
|
119
|
+
#
|
120
|
+
# ./exe/mssql-mysql-migrator copy-table ac-express-live test ad_locations
|
121
|
+
#
|
122
|
+
def copy_table(name_src, name_dst, table_name, *args)
|
123
|
+
$log.debug "copy_table(#{table_name})"
|
124
|
+
|
125
|
+
source_db = open_source_db(name_src)
|
126
|
+
table = source_db.table(table_name)
|
127
|
+
$log.info "#{table.count} #{table_name} records"
|
128
|
+
|
129
|
+
fd = if @config[:outdir]
|
130
|
+
File.open(File.join(@config[:outdir], "#{table_name}.csv"), "w")
|
131
|
+
else
|
132
|
+
Tempfile.new
|
133
|
+
end
|
134
|
+
dump_table_as_csv(fd, table)
|
135
|
+
fd.close
|
136
|
+
|
137
|
+
dest_db = open_destination_db(name_dst)
|
138
|
+
dest_db.import_table(table_name, fd.path)
|
139
|
+
|
140
|
+
[]
|
141
|
+
end
|
142
|
+
|
143
|
+
# usage: ... <database>
|
144
|
+
#
|
145
|
+
def list_tables(db_name, *args)
|
146
|
+
db = open_source_db(db_name)
|
147
|
+
tn = db.table_names
|
148
|
+
puts " -- ##{tn.count} tables in #{db_name} --\n#{tn.join(", ")}"
|
149
|
+
end
|
150
|
+
|
151
|
+
# usage: ... transfe <src db> <dest db> [<tablename>[,<tablename>]]
|
152
|
+
#
|
153
|
+
# example: ... transfer ac-express-live test users,hosts,machines
|
154
|
+
#
|
155
|
+
# when no table list is given all tables from src db are transfered
|
156
|
+
#
|
157
|
+
def transfer(name_src, name_dst, *args)
|
158
|
+
$log.debug "open source datbabase(#{name_src})"
|
159
|
+
source_db= open_source_db(name_src)
|
160
|
+
|
161
|
+
$log.debug "open destination datbabase(#{name_dst})"
|
162
|
+
dest_db = open_destination_db(name_dst)
|
163
|
+
|
164
|
+
# get list of tables from comandline or default to all from schema
|
165
|
+
tnames = (args.shift || "").split(/,\s*/)
|
166
|
+
tnames.empty? && (tnames = source_db.table_names)
|
167
|
+
|
168
|
+
tcount = tnames.count
|
169
|
+
$log.info "#{tcount} source tables"
|
170
|
+
$log.debug(tnames.join(", "))
|
171
|
+
tnames.each_with_index do |table_name, idx|
|
172
|
+
$log.info "next(#{idx+1}/#{tcount}): #{table_name}"
|
173
|
+
if exclude_table?(table_name)
|
174
|
+
$log.info "skipping excluded table: #{table_name}"
|
175
|
+
else
|
176
|
+
copy_table(name_src, name_dst, table_name)
|
177
|
+
end
|
178
|
+
end
|
179
|
+
|
180
|
+
[]
|
181
|
+
end
|
182
|
+
|
183
|
+
# usage: <db>
|
184
|
+
def dump_db(name_src, *args)
|
185
|
+
$log.info "#{self}(#{name_src}, #{args.inspect})"
|
186
|
+
[]
|
187
|
+
end
|
188
|
+
|
189
|
+
private
|
190
|
+
|
191
|
+
def exclude_table?(name)
|
192
|
+
exclude_tables.include?(name)
|
193
|
+
end
|
194
|
+
|
195
|
+
# option: --exclude-tables=users,hosts,etc.
|
196
|
+
def exclude_tables
|
197
|
+
@exclude_tables ||= (@config[:"exclude-tables"] || "").split(/,\s*/)
|
198
|
+
end
|
199
|
+
|
200
|
+
def dump_table_as_csv(fd, table)
|
201
|
+
csv = CSV.new(fd)
|
202
|
+
|
203
|
+
# first row with column names
|
204
|
+
c_names = table.columns
|
205
|
+
csv << c_names
|
206
|
+
|
207
|
+
$log.debug "dumping #{table.count} rows as csv"
|
208
|
+
table.each do |row|
|
209
|
+
begin
|
210
|
+
#debugger if row[:id] == 7047
|
211
|
+
#r = c_names.map {|c| row[c]}
|
212
|
+
#csv << prep_values(r)
|
213
|
+
csv << prep_values(c_names.map {|c| row[c]})
|
214
|
+
rescue => e
|
215
|
+
debugger rescue nil
|
216
|
+
$log.warn "bad row? #{row} -- #{e}"
|
217
|
+
end
|
218
|
+
end
|
219
|
+
end
|
220
|
+
|
221
|
+
def prep_values(values)
|
222
|
+
# In Csv I replaced all the "" with "\N" before I run the script, this
|
223
|
+
# creates a null field in db
|
224
|
+
#v = values.map {|val| val.nil? ? '\N' : val}
|
225
|
+
values.map do |val|
|
226
|
+
v = case val
|
227
|
+
when NilClass
|
228
|
+
'\N'
|
229
|
+
when Time
|
230
|
+
val.strftime("%Y-%m-%d %H:%M:%S")
|
231
|
+
when String
|
232
|
+
val.encode('CP1252').force_encoding('utf-8')
|
233
|
+
#val.force_encoding('utf-8')
|
234
|
+
when true, false
|
235
|
+
val ? 0 : 1
|
236
|
+
else
|
237
|
+
val
|
238
|
+
end
|
239
|
+
end
|
240
|
+
end
|
241
|
+
|
242
|
+
def open_source_db(name)
|
243
|
+
@source_db ||= MSSQL.new(database_config(name))
|
244
|
+
end
|
245
|
+
|
246
|
+
def open_destination_db(name)
|
247
|
+
@dest_db ||= MySQL.new(database_config(name))
|
248
|
+
end
|
249
|
+
|
250
|
+
def database_config(name)
|
251
|
+
c = YAML::load(IO.read(database_config_file))[name]
|
252
|
+
$log.debug "database: #{c}"
|
253
|
+
c
|
254
|
+
rescue Errno::ENOENT => e
|
255
|
+
dcf = database_config_file
|
256
|
+
e = File.expand_path(dcf) rescue '???'
|
257
|
+
$log.fatal("Database config file not found: '#{dcf}' @ #{e}")
|
258
|
+
raise # the original exception
|
259
|
+
end
|
260
|
+
|
261
|
+
def database_config_file
|
262
|
+
@database_config_file ||= @config[:database_config]
|
263
|
+
end
|
264
|
+
end
|
265
|
+
|
266
|
+
end # MssqlMysqlMigrator
|
267
|
+
|
268
|
+
Applix.main(ARGV, Defaults) { any(argsloop: MssqlMysqlMigrator::Main) }
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'mssql_mysql_migrator/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "mssql_mysql_migrator"
|
8
|
+
spec.version = MssqlMysqlMigrator::VERSION
|
9
|
+
spec.authors = ["dirk lüsebrink"]
|
10
|
+
spec.email = ["dirk.luesebrink@artcom.de"]
|
11
|
+
|
12
|
+
spec.summary = %q{dumping from MS SQL Server and loading to MySQL.}
|
13
|
+
spec.description = %q{Sequel is used for reading and CSV for bulk uploading.}
|
14
|
+
spec.homepage = "https://github.com/artcom/"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
18
|
+
# delete this section to allow pushing this gem to any host.
|
19
|
+
if spec.respond_to?(:metadata)
|
20
|
+
#spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
|
21
|
+
else
|
22
|
+
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
23
|
+
end
|
24
|
+
|
25
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
26
|
+
spec.bindir = "exe"
|
27
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
28
|
+
spec.require_paths = ["lib"]
|
29
|
+
|
30
|
+
spec.add_dependency 'applix', '~>0.4.14'
|
31
|
+
spec.add_dependency 'ac-logger', '~>0.1.1'
|
32
|
+
|
33
|
+
spec.add_dependency 'mysql'
|
34
|
+
spec.add_dependency 'sequel'
|
35
|
+
spec.add_dependency 'tiny_tds', '~> 0.6.3.rc1'
|
36
|
+
## MSSQL for production server connection
|
37
|
+
#spec.add_dependency 'activerecord-sqlserver-adapter'
|
38
|
+
|
39
|
+
spec.add_development_dependency "bundler", "~> 1.10"
|
40
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
41
|
+
spec.add_development_dependency "rspec"
|
42
|
+
spec.add_development_dependency "byebug"
|
43
|
+
end
|
metadata
ADDED
@@ -0,0 +1,186 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: mssql_mysql_migrator
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- dirk lüsebrink
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-06-21 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: applix
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: 0.4.14
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 0.4.14
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: ac-logger
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 0.1.1
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 0.1.1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: mysql
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: sequel
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: tiny_tds
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 0.6.3.rc1
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 0.6.3.rc1
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: bundler
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '1.10'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '1.10'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: rake
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '10.0'
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '10.0'
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rspec
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - ">="
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '0'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - ">="
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: byebug
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
description: Sequel is used for reading and CSV for bulk uploading.
|
140
|
+
email:
|
141
|
+
- dirk.luesebrink@artcom.de
|
142
|
+
executables:
|
143
|
+
- mssql-mysql-migrator
|
144
|
+
extensions: []
|
145
|
+
extra_rdoc_files: []
|
146
|
+
files:
|
147
|
+
- ".gitignore"
|
148
|
+
- ".rspec"
|
149
|
+
- ".travis.yml"
|
150
|
+
- CODE_OF_CONDUCT.md
|
151
|
+
- Gemfile
|
152
|
+
- LICENSE.txt
|
153
|
+
- README.md
|
154
|
+
- Rakefile
|
155
|
+
- bin/console
|
156
|
+
- bin/setup
|
157
|
+
- database.yml.template
|
158
|
+
- exe/mssql-mysql-migrator
|
159
|
+
- lib/mssql_mysql_migrator.rb
|
160
|
+
- lib/mssql_mysql_migrator/version.rb
|
161
|
+
- mssql_mysql_migrator.gemspec
|
162
|
+
homepage: https://github.com/artcom/
|
163
|
+
licenses:
|
164
|
+
- MIT
|
165
|
+
metadata: {}
|
166
|
+
post_install_message:
|
167
|
+
rdoc_options: []
|
168
|
+
require_paths:
|
169
|
+
- lib
|
170
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
171
|
+
requirements:
|
172
|
+
- - ">="
|
173
|
+
- !ruby/object:Gem::Version
|
174
|
+
version: '0'
|
175
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
176
|
+
requirements:
|
177
|
+
- - ">="
|
178
|
+
- !ruby/object:Gem::Version
|
179
|
+
version: '0'
|
180
|
+
requirements: []
|
181
|
+
rubyforge_project:
|
182
|
+
rubygems_version: 2.4.6
|
183
|
+
signing_key:
|
184
|
+
specification_version: 4
|
185
|
+
summary: dumping from MS SQL Server and loading to MySQL.
|
186
|
+
test_files: []
|