<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -3,7 +3,7 @@ class PosRetailSalesTransactionFact &lt; ActiveWarehouse::Fact
   aggregate :sales_dollar_amount#, :type =&gt; :sum
   aggregate :gross_profit_dollar_amount#, :type =&gt; :sum
   
-  calculated_field (:gross_margin) { |agg_rec| agg_rec.gross_profit_dollar_amount / agg_rec.sales_dollar_amount}
+  #calculated_field (:gross_margin) { |agg_rec| agg_rec.gross_profit_dollar_amount / agg_rec.sales_dollar_amount}
   
   dimension :date
   dimension :store</diff>
      <filename>app/models/pos_retail_sales_transaction_fact.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,31 +4,31 @@ class CreateDateDimension &lt; ActiveRecord::Migration
       :date =&gt; :string,
       :full_date_description =&gt; :text,
       :day_of_week =&gt; :string,
-      :day_number_in_epoch =&gt; :integer,
-      :week_number_in_epoch =&gt; :integer,
-      :month_number_in_epoch =&gt; :integer,
+      #:day_number_in_epoch =&gt; :integer,
+      #:week_number_in_epoch =&gt; :integer,
+      #:month_number_in_epoch =&gt; :integer,
       :day_number_in_calendar_month =&gt; :integer,
       :day_number_in_calendar_year =&gt; :integer,
       :day_number_in_fiscal_month =&gt; :integer,
       :day_number_in_fiscal_year =&gt; :integer,
-      :last_day_in_week_indicator =&gt; :string,
-      :last_day_in_month_indicator =&gt; :string,
+      #:last_day_in_week_indicator =&gt; :string,
+      #:last_day_in_month_indicator =&gt; :string,
       :calendar_week =&gt; :string,
-      :calendar_week_ending_date =&gt; :string,
+      #:calendar_week_ending_date =&gt; :string,
       :calendar_week_number_in_year =&gt; :integer,
       :calendar_month_name =&gt; :string,
       :calendar_month_number_in_year =&gt; :integer,
       :calendar_year_month =&gt; :string,
       :calendar_quarter =&gt; :string,
       :calendar_year_quarter =&gt; :string,
-      :calendar_half_year =&gt; :string,
+      #:calendar_half_year =&gt; :string,
       :calendar_year =&gt; :string,
       :fiscal_week =&gt; :string,
       :fiscal_week_number_in_year =&gt; :integer,
       :fiscal_year_month =&gt; :string,
       :fiscal_quarter =&gt; :string,
       :fiscal_year_quarter =&gt; :string,
-      :fiscal_half_year =&gt; :string,
+      #:fiscal_half_year =&gt; :string,
       :fiscal_year =&gt; :string,
       :holiday_indicator =&gt; :string,
       :weekday_indicator =&gt; :string,</diff>
      <filename>db/migrate/001_create_date_dimension.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,6 +7,7 @@ class CreateStoreDimension &lt; ActiveRecord::Migration
       :store_city =&gt; {:type =&gt; :string, :limit =&gt; 20},
       :store_county =&gt; {:type =&gt; :string, :limit =&gt; 20},
       :store_state =&gt; {:type =&gt; :string, :limit =&gt; 2},
+      :store_state_name =&gt; {:type =&gt; :string, :limit =&gt; 40},
       :store_zip_code =&gt; {:type =&gt; :string, :limit =&gt; 10},
       :store_manager =&gt; {:type =&gt; :string, :limit =&gt; 30},
       :store_district =&gt; {:type =&gt; :string, :limit =&gt; 20},</diff>
      <filename>db/migrate/003_create_store_dimension.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,7 +5,7 @@ $:.unshift(File.dirname(__FILE__))
 require File.dirname(__FILE__) + '/../config/environment'
 
 # Copied from rake task
-ddb = ActiveWarehouse::Builder::DateDimensionBuilder.new(Time.now.years_ago(5), Time.now) # TODO: start and end dates should be configurable?
+ddb = ActiveWarehouse::Builder::DateDimensionBuilder.new(Date.new(2001, 1, 1), Date.new(2007, 1, 1))
 ddb.build.each do |record|
   dd = DateDimension.new
   record.each do |key,value|
@@ -15,4 +15,5 @@ ddb.build.each do |record|
 end
 
 require 'setup/store'
+require 'setup/product'
 require 'setup/pos_retail_sales_transaction'
\ No newline at end of file</diff>
      <filename>db/setup.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,18 +1,16 @@
 #!/usr/bin/env ruby
 
-require File.dirname(__FILE__) + '/../../config/environment'
-
 facts = [
-  [1, 1, 1, 1, 'ABC000000001', 3, 3.45, 1.56],
-  [300, 3, 1, 1, 'ABC000000002', 1, 1.34, 0.72],
-  [600, 3, 1, 1, 'ABC000000003', 2, 2.68, 1.44],
-  [1800, 3, 1, 1, 'ABC000000004', 1, 1.34, 0.72],
-  [1800, 2, 1, 1, 'ABC000000005', 1, 0.94, 0.34],
-  [1801, 1, 1, 1, 'ABC000000006', 2, 2.68, 1.44],
-  [1, 1, 2, 1, 'DEF000000001', 3, 3.45, 1.56],
-  [300, 3, 2, 1, 'DEF000000002', 1, 1.34, 0.72],
-  [600, 3, 2, 1, 'DEF000000003', 2, 2.68, 1.44],
-  [1800, 3, 2, 1, 'DEF000000004', 1, 1.34, 0.72]
+  [1, 1, 1, 1, 'ABC000000001', 3, 3.00, 1.50],
+  [366, 3, 1, 1, 'ABC000000002', 1, 1.00, 0.50],
+  [732, 3, 1, 1, 'ABC000000003', 2, 2.00, 1.00],
+  [1098, 3, 1, 1, 'ABC000000004', 1, 1.00, 0.50],
+  [1098, 2, 1, 1, 'ABC000000005', 1, 1.00, 0.50],
+  [1098, 1, 1, 1, 'ABC000000006', 2, 2.00, 1.00],
+  [1, 1, 2, 1, 'DEF000000001', 3, 3.00, 1.50],
+  [300, 3, 2, 1, 'DEF000000002', 1, 1.00, 0.50],
+  [600, 3, 2, 1, 'DEF000000003', 2, 2.00, 1.00],
+  [1800, 3, 2, 1, 'DEF000000004', 1, 1.00, 0.50]
 ]
 
 connection = PosRetailSalesTransactionFact.connection</diff>
      <filename>db/setup/pos_retail_sales_transaction.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,7 +1,5 @@
 #!/usr/bin/env ruby
 
-require File.dirname(__FILE__) + '/../../config/environment'
-
 products = [
   ['Crunchy Chips', '00399494302', 'Delicious Brands', 'Snack Foods', 'Snack Foods', 'Bag', 'Small', 'Regular Fat', 24, 'Ounces', 'Non Refrigerated', '3 Years', 6, 12, 3],
   ['Low Fat Crunchy Chips', '00399494303', 'Delicious Brands', 'Snack Foods', 'Snack Foods', 'Bag', 'Small', 'Low Fat', 24, 'Ounces', 'Non Refrigerated', '3 Years', 6, 12, 3],
@@ -15,23 +13,14 @@ products = [
 connection = ProductDimension.connection
 connection.execute(&quot;TRUNCATE TABLE #{ProductDimension.table_name}&quot;)
 
+order = [
+  :product_description, :sku_number, :brand_description, :category_description, :department_description,
+  :package_type_description, :package_size, :fat_content, :diet_type, :weight, :weight_units_of_measure,
+  :storage_type, :shelf_life_type, :shelf_width, :shelf_height, :shelf_depth
+]
+
 products.each do |product|
-  ProductDimension.create(
-    :product_description =&gt; product[0],
-    :sku_number =&gt; product[1],
-    :brand_description =&gt; product[2],
-    :category_description =&gt; product[3],
-    :department_description =&gt; product[4],
-    :package_type_description =&gt; product[5],
-    :package_size =&gt; product[6],
-    :fat_content =&gt; product[7],
-    :diet_type =&gt; product[8],
-    :weight =&gt; product[9],
-    :weight_units_of_measure =&gt; product[10],
-    :storage_type =&gt; product[11],
-    :shelf_life_type =&gt; product[12],
-    :shelf_width =&gt; product[13],
-    :shelf_height =&gt; product[14],
-    :shelf_depth =&gt; product[15]
-  )
+  attributes = {}
+  order.each_with_index { |field, index| attributes[field] = product[index] }
+  ProductDimension.create(attributes)
 end</diff>
      <filename>db/setup/product.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,38 +1,25 @@
 #!/usr/bin/env ruby
 
-require File.dirname(__FILE__) + '/../../config/environment'
-
 stores = [
-  ['Store 1','Store 1','101 SW 1st Street','Miami','Miami-Dade','Florida','33143','Bob Smith','South Florida','Southeast','XXX','24 Hour','XXX', 10300, 12390, 1, 600],
-  ['Store 2','Store 2','300 SW 42nd Ave','South Miami','Miami-Dade','Florida','33148','John Toms','South Florida','Southeast','XXX','24 Hour','XXX', 10300, 12390, 1, 600],
-  ['Store 3','Store 3','2000 Smith Stree','Boca Raton','Boca Raton','Florida','37840','Jane Doe','South Florida','Southeast','XXX','24 Hour','XXX', 10300, 12390, 1, 600],
-  ['Store 4','Store 4','11 Babcock Street','Melbourne','Brevard','Florida','32911','Jeff Smith','Central Florida','Southeast','XXX','24 Hour','XXX', 10300, 12390, 1, 600],
-  ['Store 5','Store 5','101 SW 1st Street','Orlando','Orange','Florida','36544','Joe Johnson','Central Florida','Southeast','XXX','24 Hour','XXX', 10300, 12390, 1, 600],
-  ['Store 6','Store 6','101 SW 1st Street','Jacksonville','Miami-Dade','Florida','33143','Bob Smith','South Florida','Southeast','XXX','24 Hour','XXX', 10300, 12390, 1, 600],
-  ['Store 7','Store 7','11 Broadway','New York','New York','New York','00101','John Smith','New York','Northeast','XXX','24 Hour','XXX', 10300, 12390, 1, 600]
+  ['Store 1','Store 1','101 SW 1st Street','Miami','Miami-Dade','FL','Florida','33143','Bob Smith','South Florida','Southeast','XXX','24 Hour','XXX', 10300, 12390, 1, 600],
+  ['Store 2','Store 2','300 SW 42nd Ave','South Miami','Miami-Dade','FL','Florida','33148','John Toms','South Florida','Southeast','XXX','24 Hour','XXX', 10300, 12390, 1, 600],
+  ['Store 3','Store 3','2000 Smith Stree','Boca Raton','Boca Raton','FL','Florida','37840','Jane Doe','South Florida','Southeast','XXX','24 Hour','XXX', 10300, 12390, 1, 600],
+  ['Store 4','Store 4','11 Babcock Street','Melbourne','Brevard','FL','Florida','32911','Jeff Smith','Central Florida','Southeast','XXX','24 Hour','XXX', 10300, 12390, 1, 600],
+  ['Store 5','Store 5','101 SW 1st Street','Orlando','Orange','FL','Florida','36544','Joe Johnson','Central Florida','Southeast','XXX','24 Hour','XXX', 10300, 12390, 1, 600],
+  ['Store 6','Store 6','101 SW 1st Street','Jacksonville','Miami-Dade','FL','Florida','33143','Bob Smith','South Florida','Southeast','XXX','24 Hour','XXX', 10300, 12390, 1, 600],
+  ['Store 7','Store 7','11 Broadway','New York','New York','NY','New York','00101','John Smith','New York','Northeast','XXX','24 Hour','XXX', 10300, 12390, 1, 600]
 ]
 
 connection = StoreDimension.connection
 connection.execute(&quot;TRUNCATE TABLE #{StoreDimension.table_name}&quot;)
 
+order = [:store_name, :store_number, :store_street_address, :store_city, :store_county, :store_state,
+:store_state_name, :store_zip_code, :store_manager, :store_district, :store_region, :floor_plan_type,
+:photo_processing_type, :financial_service_type, :selling_square_footage, :total_square_footage,
+:first_open_date, :last_remodal_date]
+
 stores.each do |store|
-  StoreDimension.create(
-    :store_name =&gt; store[0], 
-    :store_number =&gt; store[1], 
-    :store_street_address =&gt; store[2], 
-    :store_city =&gt; store[3],
-    :store_county =&gt; store[4],
-    :store_state =&gt; store[5],
-    :store_zip_code =&gt; store[6],
-    :store_manager =&gt; store[7],
-    :store_district =&gt; store[8],
-    :store_region =&gt; store[9],
-    :floor_plan_type =&gt; store[10],
-    :photo_processing_type =&gt; store[11],
-    :financial_service_type =&gt; store[12],
-    :selling_square_footage =&gt; store[13],
-    :total_square_footage =&gt; store[14],
-    :first_open_date =&gt; store[15], # FK with view on date_dimension
-    :last_remodal_date =&gt; store[16] # FK with view on date_dimension
-  )
+  attributes = {}
+  order.each_with_index { |field, index| attributes[field] = store[index]}
+  StoreDimension.create!(attributes)
 end</diff>
      <filename>db/setup/store.rb</filename>
    </modified>
    <modified>
      <diff>@@ -5,4 +5,9 @@ namespace :db do
     ActiveRecord::Base.establish_connection(abcs[RAILS_ENV])
     ActiveRecord::Base.connection.recreate_database(ActiveRecord::Base.connection.current_database)
   end
-end
\ No newline at end of file
+end
+
+task :setup =&gt; :environment do
+  require File.dirname(__FILE__) + '/../../db/setup'
+end
+  
\ No newline at end of file</diff>
      <filename>lib/tasks/databases.rake</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>03beae0020d8d014c6c2c7d0f15e99311fd3dda5</id>
    </parent>
  </parents>
  <author>
    <name>aeden</name>
    <email>aeden@78b0de1e-7a20-0410-a083-82450d3afd0a</email>
  </author>
  <url>http://github.com/bcotton/activewarehouse-demo/commit/94bde96998aed38f82c63cd0b7dbe362216ab396</url>
  <id>94bde96998aed38f82c63cd0b7dbe362216ab396</id>
  <committed-date>2007-04-12T17:56:16-07:00</committed-date>
  <authored-date>2007-04-12T17:56:16-07:00</authored-date>
  <message>cleaned up

git-svn-id: svn://rubyforge.org/var/svn/activewarehouse/demo/trunk@587 78b0de1e-7a20-0410-a083-82450d3afd0a</message>
  <tree>dd3248c40031ffe7bf373e507a90eb87b405f168</tree>
  <committer>
    <name>aeden</name>
    <email>aeden@78b0de1e-7a20-0410-a083-82450d3afd0a</email>
  </committer>
</commit>
