[PATCH conductor 06/22] ProviderPriorityGroup related migrations

ifarkas at redhat.com ifarkas at redhat.com
Thu Aug 2 12:24:57 UTC 2012


From: Imre Farkas <ifarkas at redhat.com>

---
 ...120710131251_create_provider_priority_groups.rb | 31 ++++++++++++++++++++++
 ...4428_create_provider_priority_group_elements.rb | 30 +++++++++++++++++++++
 2 files changed, 61 insertions(+)
 create mode 100644 src/db/migrate/20120710131251_create_provider_priority_groups.rb
 create mode 100644 src/db/migrate/20120710134428_create_provider_priority_group_elements.rb

diff --git a/src/db/migrate/20120710131251_create_provider_priority_groups.rb b/src/db/migrate/20120710131251_create_provider_priority_groups.rb
new file mode 100644
index 0000000..ee89cfc
--- /dev/null
+++ b/src/db/migrate/20120710131251_create_provider_priority_groups.rb
@@ -0,0 +1,31 @@
+#
+#   Copyright 2012 Red Hat, Inc.
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#
+
+class CreateProviderPriorityGroups < ActiveRecord::Migration
+  def self.up
+    create_table :provider_priority_groups do |t|
+      t.string :name
+      t.integer :score, :null => false
+      t.references :pool
+
+      t.timestamps
+    end
+  end
+
+  def self.down
+    drop_table :provider_priority_groups
+  end
+end
diff --git a/src/db/migrate/20120710134428_create_provider_priority_group_elements.rb b/src/db/migrate/20120710134428_create_provider_priority_group_elements.rb
new file mode 100644
index 0000000..0780457
--- /dev/null
+++ b/src/db/migrate/20120710134428_create_provider_priority_group_elements.rb
@@ -0,0 +1,30 @@
+#
+#   Copyright 2012 Red Hat, Inc.
+#
+#   Licensed under the Apache License, Version 2.0 (the "License");
+#   you may not use this file except in compliance with the License.
+#   You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#
+
+class CreateProviderPriorityGroupElements < ActiveRecord::Migration
+  def self.up
+    create_table :provider_priority_group_elements do |t|
+      t.references :provider_priority_group, :null => false
+      t.references :value, :null => false, :polymorphic => true
+
+      t.timestamps
+    end
+  end
+
+  def self.down
+    drop_table :provider_priority_group_elements
+  end
+end
-- 
1.7.11.2




More information about the aeolus-devel mailing list