sequel_migration_builder 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- NGRmODU3NzY1NDA1MGIyNjllMjE3ODA1ZjY0ZWIyNzE3MWRjMTdhZQ==
4
+ NzM5ODM5Y2Q4Y2RkZjFhZjM0ZTE0YjdhZTAxZmRjOWQ5NGYzN2I5OA==
5
5
  data.tar.gz: !binary |-
6
- NDFiMmJkZjlkNDA2YTVlMTdkODExYzY2NzQ3Yzg2ZDk4MWVmOWQxYQ==
6
+ MjNhMWJmZTE4OGQwMDg4ZDc2ZjgyZTZiOWE3ZmVkYTYxNzM3MWFjOA==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MjNiZjk0NTA3MmUxYWYxMmIwZjY4MDcyNjgwYjBlY2Y1ZmNiMTI3ZDJhOTU5
10
- M2RjZDI2MTc3MGU4ODVmNWQ5N2ZlYzEwMGY2NzIyODc1ZjViMDM2ZTI0MTVl
11
- NGI0OWRiODQ0ZDEwYWM1NGY4NjhiMzg1MzJlMmU4NGQwYjlhY2I=
9
+ NGFlZDc2NzQyMzY0MDljMmM0ZWY5YTAxMzkyOTgwMTFmYzE3NmZiMDM3YzJm
10
+ NjZkNDJhMWFiNGUxODFiMzM2NmJhZTNmOWFkYTlkY2JmYTQ4MjZiYmIyNDFm
11
+ OWIyNGJjZGM2NzMwM2YxM2EwZmYzZDQxN2FkMzkyODQxZTU2Yjk=
12
12
  data.tar.gz: !binary |-
13
- ZTVlYzE0YTViNjNmNDg5MTY4ODNmOTVhYTI4ZGY1NWFlZDQxYzA1MGFjMzdj
14
- YjU4YzgxOTU2ZjYxYTcwNDVjNGM0ZDZiZDdkNzAyMzg5NDI2NzNmNTMwNDY3
15
- OWE0YWNiMDlhZWM4MmU2MzY0MTQ1MWI0NWFlNGFkYTM1N2NiYzM=
13
+ MmEwMDM2ZWZjYTZlZTYzNTk2NjQ3MDAxNDcwOGZhNDg4MWE5YTAxOTI4Mjkz
14
+ MzBjYWQzYjllZjdjOGRjZGY4ZGFjZTNmYzYzODFmODUwZWEzNDUxZmUyYTgz
15
+ ZDUzYzYyMjg0NDU0NDIwYzZkYTRjNjE2MDMxMjM5OTYzMzU2MDY=
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.1
1
+ 0.4.2
@@ -84,8 +84,12 @@ module Sequel
84
84
  private
85
85
 
86
86
  def extract_default(column)
87
- default = column.last[:ruby_default] || column.last[:default]
88
- default =~ /^"identity/ ? nil : default
87
+ if column.last[:ruby_default].nil?
88
+ default = column.last[:default]
89
+ default =~ /^"identity/ ? nil : default
90
+ else
91
+ default = column.last[:ruby_default]
92
+ end
89
93
  end
90
94
 
91
95
  def extract_unsigned(db_type_string, type)
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: sequel_migration_builder 0.4.1 ruby lib
5
+ # stub: sequel_migration_builder 0.4.2 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "sequel_migration_builder"
9
- s.version = "0.4.1"
9
+ s.version = "0.4.2"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["Roland Swingler"]
14
- s.date = "2014-09-02"
14
+ s.date = "2014-09-03"
15
15
  s.description = "Build Sequel Migrations based on the differences between two schemas"
16
16
  s.email = "roland.swingler@gmail.com"
17
17
  s.extra_rdoc_files = [
@@ -56,6 +56,14 @@ describe "Sequel::Schema::AlterTableOperations#build_column_operations" do
56
56
  expect(ops.first).to eql("set_column_default :foo, 2")
57
57
  end
58
58
 
59
+ it "not have an operation for assumed boolean false" do
60
+ a = build_column(:name => :foo, :column_type => :boolean, :null => false, :default => nil)
61
+ b = build_column(:name => :foo, :column_type => :boolean, :null => false, :default => false)
62
+ ops = @subject.build_column_operations(a,b)
63
+
64
+ expect(ops).to be_empty
65
+ end
66
+
59
67
  it "should only return 1 operation if the default and other values are different" do
60
68
  a = build_column(:name => :foo, :column_type => :integer, :default => 1)
61
69
  b = build_column(:name => :foo, :column_type => :smallint, :default => 2)
@@ -26,6 +26,11 @@ describe "A hash in the array returned by Sequel::Schema::DbSchemaParser#parse_t
26
26
  it "should contain the ruby_default as the :default" do
27
27
  expect(@parser.parse_table_schema(@schema).first.default).to eql(1)
28
28
  end
29
+
30
+ it "should contain the ruby_default as the :default when that default is false" do
31
+ @schema.first.last.merge!(:default => "false", :ruby_default => false)
32
+ expect(@parser.parse_table_schema(@schema).first.default).to eql(false)
33
+ end
29
34
 
30
35
  it "should contain whether the column can be :null" do
31
36
  expect(@parser.parse_table_schema(@schema).first.null).to eql(true)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sequel_migration_builder
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roland Swingler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-02 00:00:00.000000000 Z
11
+ date: 2014-09-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel