chicagowarehouse 0.3.3 → 0.4.0

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/Rakefile CHANGED
@@ -14,7 +14,7 @@ require 'rake'
14
14
  require 'jeweler'
15
15
  Jeweler::Tasks.new do |gem|
16
16
  gem.name = "chicagowarehouse"
17
- gem.version = "0.3.3"
17
+ gem.version = "0.4.0"
18
18
  gem.summary = "Ruby Data Warehousing"
19
19
  gem.description = "Simple Data Warehouse toolkit for ruby"
20
20
  gem.author = "Roland Swingler"
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{chicagowarehouse}
8
- s.version = "0.3.3"
8
+ s.version = "0.4.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = [%q{Roland Swingler}]
@@ -18,18 +18,8 @@ module Chicago
18
18
  end
19
19
 
20
20
  def visit_dimension(dimension)
21
- table = basic_table(dimension)
22
-
23
- # TODO: Why shouldn't facts have etl_batch_id?
24
- table[:columns] << {
25
- :name => :etl_batch_id,
26
- :column_type => :integer,
27
- :unsigned => true
28
- }
29
-
30
- tables = {dimension.table_name => table}
31
- tables.merge!(key_table(dimension))
32
- tables
21
+ {dimension.table_name => basic_table(dimension)}.
22
+ merge!(key_table(dimension))
33
23
  end
34
24
 
35
25
  def visit_column(column)
@@ -52,7 +42,14 @@ module Chicago
52
42
  :unsigned => true
53
43
  }]
54
44
  }
45
+
55
46
  t[:columns] += table.columns.map {|c| c.visit(self) }
47
+ t[:columns] << {
48
+ :name => :_inserted_at,
49
+ :column_type => :timestamp,
50
+ :null => true
51
+ }
52
+
56
53
  t
57
54
  end
58
55
 
@@ -65,6 +65,11 @@ describe Chicago::Database::SchemaGenerator do
65
65
  :reference_idx => { :columns => :reference, :unique => false }
66
66
  }
67
67
  end
68
+
69
+ it "has an inserted at column" do
70
+ subject.visit_fact(@fact)[:facts_sales][:columns].
71
+ should include(:name => :_inserted_at, :column_type => :timestamp, :null => true)
72
+ end
68
73
  end
69
74
 
70
75
  describe "#visit_dimension" do
@@ -190,10 +195,10 @@ describe Chicago::Database::SchemaGenerator do
190
195
  subject.visit_dimension(@dimension)[:keys_dimension_currency].should be_nil
191
196
  end
192
197
 
193
- it "should have an unsigned integer :etl_batch_id column" do
198
+ it "has an inserted at column" do
194
199
  @dimension = @schema.define_dimension(:user)
195
- expected = {:name => :etl_batch_id, :column_type => :integer, :unsigned => true}
196
- subject.visit_dimension(@dimension)[:dimension_user][:columns].should include(expected)
200
+ subject.visit_dimension(@dimension)[:dimension_user][:columns].
201
+ should include(:name => :_inserted_at, :column_type => :timestamp, :null => true)
197
202
  end
198
203
  end
199
204
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chicagowarehouse
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 15
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
- - 3
9
- - 3
10
- version: 0.3.3
8
+ - 4
9
+ - 0
10
+ version: 0.4.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Roland Swingler