[PATCH conductor 06/15] Add PriorityGroup related migrations

ifarkas at redhat.com ifarkas at redhat.com
Sun Jul 22 10:16:26 UTC 2012


From: Imre Farkas <ifarkas at redhat.com>

---
 ...0120710131251_create_provider_priority_group.rb |   31 ++++++++++++++++++++
 ...34428_create_provider_priority_group_element.rb |   30 +++++++++++++++++++
 2 files changed, 61 insertions(+)
 create mode 100644 src/db/migrate/20120710131251_create_provider_priority_group.rb
 create mode 100644 src/db/migrate/20120710134428_create_provider_priority_group_element.rb

diff --git a/src/db/migrate/20120710131251_create_provider_priority_group.rb b/src/db/migrate/20120710131251_create_provider_priority_group.rb
new file mode 100644
index 0000000..d4d7862
--- /dev/null
+++ b/src/db/migrate/20120710131251_create_provider_priority_group.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 CreateProviderPriorityGroup < 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_element.rb b/src/db/migrate/20120710134428_create_provider_priority_group_element.rb
new file mode 100644
index 0000000..fb1c7a1
--- /dev/null
+++ b/src/db/migrate/20120710134428_create_provider_priority_group_element.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 CreateProviderPriorityGroupElement < 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.10.4




More information about the aeolus-devel mailing list