rubyrep 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/config/mysql_config.rb +5 -2
- data/lib/rubyrep/connection_extenders/postgresql_extender.rb +1 -8
- data/lib/rubyrep/version.rb +1 -1
- data/tasks/database.rake +9 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 213e858c035fb240427f3483d5e3254f7e6ea7a0
|
4
|
+
data.tar.gz: a63ca55ad8809f1fb3de2820a2f14f2c895f3db7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e96f69319d4c3960388eaca5e138ab698b3eb91b0b1eaa43f36ccb018e6fe1956bd0d13a7e7a813fb64eab0e5d8b924c90b77514b100b896a5b26f129db116d9
|
7
|
+
data.tar.gz: 81a028f93318f91bf348d8c64bfafb4ab968be7b3441aad46f2fa9f66f8e024d5d92174f43bc640ca1338a98ab5e9f0ce11143e3eee1231871c10633cf25dbcd
|
data/config/mysql_config.rb
CHANGED
@@ -2,10 +2,13 @@
|
|
2
2
|
# Defines connection parameters to the mysql databases.
|
3
3
|
|
4
4
|
RR::Initializer::run do |config|
|
5
|
+
|
6
|
+
mysql_user = RUBY_PLATFORM == 'java' && 'root' || `whoami`.strip
|
7
|
+
|
5
8
|
config.left = {
|
6
9
|
:adapter => 'mysql2',
|
7
10
|
:database => 'rr_left',
|
8
|
-
:username =>
|
11
|
+
:username => mysql_user,
|
9
12
|
:password => '',
|
10
13
|
:host => 'localhost',
|
11
14
|
:port => 3306,
|
@@ -15,7 +18,7 @@ RR::Initializer::run do |config|
|
|
15
18
|
config.right = {
|
16
19
|
:adapter => 'mysql2',
|
17
20
|
:database => 'rr_right',
|
18
|
-
:username =>
|
21
|
+
:username => mysql_user,
|
19
22
|
:password => '',
|
20
23
|
:host => 'localhost',
|
21
24
|
:port => 3306,
|
@@ -109,14 +109,7 @@ module RR
|
|
109
109
|
# @param [ActiveRecord::ConnectionAdapters::PostgreSQLColumn] column the target column
|
110
110
|
# @return [String] the quoted string
|
111
111
|
def column_aware_quote(value, column)
|
112
|
-
|
113
|
-
quoted_value = "'#{escape_bytea value}'"
|
114
|
-
# tests showed that there is a wrong leading double backslash under JRuby
|
115
|
-
quoted_value.sub!(/\\\\/, '\\')
|
116
|
-
quoted_value
|
117
|
-
else
|
118
|
-
quote value
|
119
|
-
end
|
112
|
+
quote column.type_cast_for_database value
|
120
113
|
end
|
121
114
|
|
122
115
|
# Casts a value returned from the database back into the according ruby type.
|
data/lib/rubyrep/version.rb
CHANGED
data/tasks/database.rake
CHANGED
@@ -325,6 +325,13 @@ def create_sample_schema(database, config)
|
|
325
325
|
FOREIGN KEY (first_fk, second_fk)
|
326
326
|
REFERENCES referenced_table(first_id, second_id)
|
327
327
|
end_sql
|
328
|
+
|
329
|
+
create_table :postgres_types do |t|
|
330
|
+
t.text :text_array, array: true
|
331
|
+
t.float :float_array, array: true
|
332
|
+
t.json :json
|
333
|
+
t.jsonb :jsonb
|
334
|
+
end
|
328
335
|
end
|
329
336
|
end
|
330
337
|
end
|
@@ -337,6 +344,7 @@ def drop_sample_schema(config)
|
|
337
344
|
ActiveRecord::Base.establish_connection config
|
338
345
|
|
339
346
|
ActiveRecord::Schema.define do
|
347
|
+
drop_table :postgres_types rescue nil
|
340
348
|
drop_table :rr_referencing rescue nil
|
341
349
|
drop_table :rr_duplicate rescue nil
|
342
350
|
drop_table :table_with_strange_key rescue nil
|
@@ -353,7 +361,7 @@ def drop_sample_schema(config)
|
|
353
361
|
drop_table :referencing_table rescue nil
|
354
362
|
drop_table :referenced_table rescue nil
|
355
363
|
drop_table :referenced_table2 rescue nil
|
356
|
-
drop_table :table_with_manual_key
|
364
|
+
drop_table :table_with_manual_key rescue nil
|
357
365
|
drop_table :rr_pending_changes rescue nil
|
358
366
|
drop_table :rr_logged_events rescue nil
|
359
367
|
drop_table :rr_running_flags rescue nil
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubyrep
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arndt Lehmann
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-06
|
11
|
+
date: 2017-09-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|