knjrbfw 0.0.40 → 0.0.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.40
1
+ 0.0.41
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{knjrbfw}
8
- s.version = "0.0.40"
8
+ s.version = "0.0.41"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Kasper Johansen"]
@@ -74,7 +74,7 @@ class KnjDB_sqlite3::Columns::Column
74
74
  if !@type
75
75
  if match = @args[:data][:type].match(/^([A-z]+)$/)
76
76
  @maxlength = false
77
- type = match[0]
77
+ type = match[0].to_sym
78
78
  elsif match = @args[:data][:type].match(/^decimal\((\d+),(\d+)\)$/)
79
79
  @maxlength = "#{match[1]},#{match[2]}"
80
80
  type = :decimal
@@ -128,7 +128,6 @@ class KnjDB_sqlite3::Columns::Column
128
128
 
129
129
  #Returns true if the column is the primary key.
130
130
  def primarykey?
131
- return true if self.name.to_s == "id"
132
131
  return false if @args[:data][:pk].to_i == 0
133
132
  return true
134
133
  end
@@ -154,7 +153,7 @@ class KnjDB_sqlite3::Columns::Column
154
153
  newdata["maxlength"] = self.maxlength if !newdata.key?("maxlength") and self.maxlength
155
154
  newdata["null"] = self.null? if !newdata.key?("null")
156
155
  newdata["default"] = self.default if !newdata.key?("default")
157
- newdata.delete("primarykey") if newdata.key?("primarykey")
156
+ newdata["primarykey"] = self.primarykey? if !newdata.key?("primarykey")
158
157
 
159
158
  @type = nil
160
159
  @maxlength = nil
@@ -95,6 +95,11 @@ class Knj::Db::Revision
95
95
  dochange = true
96
96
  end
97
97
 
98
+ if col_data.has_key?("primarykey") and col_obj.primarykey? != col_data["primarykey"]
99
+ print "Primary-key mismatch for #{col_str}: #{col_data["primarykey"]}, #{col_obj.primarykey?}\n" if args["debug"]
100
+ dochange = true
101
+ end
102
+
98
103
  if col_data.has_key?("maxlength") and col_obj.maxlength.to_s != col_data["maxlength"].to_s
99
104
  print "Maxlength mismatch on #{col_str}: #{col_data["maxlength"]}, #{col_obj.maxlength}\n" if args["debug"]
100
105
  dochange = true
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: knjrbfw
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.40
5
+ version: 0.0.41
6
6
  platform: ruby
7
7
  authors:
8
8
  - Kasper Johansen
@@ -377,7 +377,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
377
377
  requirements:
378
378
  - - ">="
379
379
  - !ruby/object:Gem::Version
380
- hash: 2365172852586319088
380
+ hash: 632111132898720837
381
381
  segments:
382
382
  - 0
383
383
  version: "0"