summaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20090323224724_add_type_to_enumerations.rb9
-rw-r--r--db/migrate/20090401221305_update_enumerations_to_sti.rb11
2 files changed, 20 insertions, 0 deletions
diff --git a/db/migrate/20090323224724_add_type_to_enumerations.rb b/db/migrate/20090323224724_add_type_to_enumerations.rb
new file mode 100644
index 000000000..c2aef5e4a
--- /dev/null
+++ b/db/migrate/20090323224724_add_type_to_enumerations.rb
@@ -0,0 +1,9 @@
+class AddTypeToEnumerations < ActiveRecord::Migration
+ def self.up
+ add_column :enumerations, :type, :string
+ end
+
+ def self.down
+ remove_column :enumerations, :type
+ end
+end
diff --git a/db/migrate/20090401221305_update_enumerations_to_sti.rb b/db/migrate/20090401221305_update_enumerations_to_sti.rb
new file mode 100644
index 000000000..50bd52010
--- /dev/null
+++ b/db/migrate/20090401221305_update_enumerations_to_sti.rb
@@ -0,0 +1,11 @@
+class UpdateEnumerationsToSti < ActiveRecord::Migration
+ def self.up
+ Enumeration.update_all("type = 'IssuePriority'", "opt = 'IPRI'")
+ Enumeration.update_all("type = 'DocumentCategory'", "opt = 'DCAT'")
+ Enumeration.update_all("type = 'TimeEntryActivity'", "opt = 'ACTI'")
+ end
+
+ def self.down
+ # no-op
+ end
+end