Introduction
Introduction Statistics Contact Development Disclaimer Help
updated migration template - reportable - Fork of reportable required by WarVox…
Log
Files
Refs
README
---
commit dce778951a2e3f254ecd0de4845dbf732c53ae2b
parent f9df5dd39ba665417bbfb88a42950fc2ad4ba78e
Author: marcoow <[email protected]>
Date: Fri, 12 Dec 2008 01:47:56 +0800
updated migration template
Signed-off-by: Marco Otte-Witte <[email protected]>
Diffstat:
M generators/reports_as_sparkline_mi… | 47 ++++++++++++++-------------…
1 file changed, 21 insertions(+), 26 deletions(-)
---
diff --git a/generators/reports_as_sparkline_migration/templates/migration.erb …
@@ -1,32 +1,27 @@
class <%= class_name %> < ActiveRecord::Migration
- def self.up
- create_table :report_caches, :force => true do |t|
- t.string :model_name, :null => false
- t.string :report_name, :null => false
- t.string :report_grouping, :null => false
- t.float :value, :null => false, :default => 0
- t.datetime :reporting_period, :null => false
+ create_table :report_caches, :force => true do |t|
+ t.string :model_name, :null => false
+ t.string :report_name, :null => false
+ t.string :grouping, :null => false
+ t.string :aggregation, :null => false
+ t.float :value, :null => false, :default => 0
+ t.string :reporting_period, :null => false
- t.timestamps
- end
- add_index :report_caches, [
- :model_name,
- :report_name,
- :report_grouping
- ], :name => 'name_klass_grouping'
- add_index :report_caches, [
- :model_name, :report_name,
- :report_grouping,
- :reporting_period
- ], :unique => true, :name => 'report_caches_name_klass_grouping_period'
- end
-
- def self.down
- remove_index :report_caches, :name_klass_grouping
- remove_index :report_caches, :report_caches_name_klass_grouping_period
-
- drop_table :report_caches
+ t.timestamps
end
+ add_index :report_caches, [
+ :model_name,
+ :report_name,
+ :grouping,
+ :aggregation
+ ], :name => 'name_model_grouping_agregation'
+ add_index :report_caches, [
+ :model_name,
+ :report_name,
+ :grouping,
+ :aggregation,
+ :reporting_period
+ ], :unique => true, :name => 'name_model_grouping_aggregation_period'
end
You are viewing proxied material from jay.scot. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.