blue-shift 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/blueshift/version.rb +1 -1
- data/lib/sequel/extensions/schema_dumper_ext.rb +10 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 26d2163136534a2d679573b00ef2661909d8c667
|
4
|
+
data.tar.gz: 520651258fc18c663fdac086f85d1a9fa83116ad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b238993bdf64330e945de587ff0f70a5d39f6896a93cdf6e7152f06c73c500ed76a930ee4272fdad61eeaff7cce4016687a2f6257216e33bcac9938ac5a36ada
|
7
|
+
data.tar.gz: 1e876b52b7b566ae20a329ee7b2ed93571d6e282d034561febb527ba31ab88b7851826eff404bf8609c28a7e227a9ef857a53e3bf5f6a87eb2b5ffb7193958cb
|
data/lib/blueshift/version.rb
CHANGED
@@ -2,9 +2,19 @@ require 'sequel/extensions/schema_dumper'
|
|
2
2
|
module Sequel
|
3
3
|
module SchemaDumper
|
4
4
|
alias_method :dump_table_schema_without_force, :dump_table_schema
|
5
|
+
alias_method :column_schema_to_ruby_type_without_uuid, :column_schema_to_ruby_type
|
5
6
|
|
6
7
|
def dump_table_schema(table, opts=OPTS)
|
7
8
|
dump_table_schema_without_force(table, opts).gsub('create_table(', 'create_table!(')
|
8
9
|
end
|
10
|
+
|
11
|
+
def column_schema_to_ruby_type(schema)
|
12
|
+
case schema[:db_type].downcase
|
13
|
+
when 'uuid'
|
14
|
+
{type: :uuid}
|
15
|
+
else
|
16
|
+
column_schema_to_ruby_type_without_uuid(schema)
|
17
|
+
end
|
18
|
+
end
|
9
19
|
end
|
10
20
|
end
|