From d47e422f7e663fd086d2bb4c9da0660973c0f36e Mon Sep 17 00:00:00 2001 From: skovic Date: Thu, 1 Jun 2017 16:20:33 -0400 Subject: [PATCH 1/6] Initial schema work to support network adapters --- .../20170524173850_add_guest_device_id_to_firmwares.rb | 6 ++++++ ...530180114_add_manufacturer_and_fru_to_guest_devices.rb | 8 ++++++++ db/schema.yml | 4 ++++ 3 files changed, 18 insertions(+) create mode 100644 db/migrate/20170524173850_add_guest_device_id_to_firmwares.rb create mode 100644 db/migrate/20170530180114_add_manufacturer_and_fru_to_guest_devices.rb diff --git a/db/migrate/20170524173850_add_guest_device_id_to_firmwares.rb b/db/migrate/20170524173850_add_guest_device_id_to_firmwares.rb new file mode 100644 index 000000000..d7613768e --- /dev/null +++ b/db/migrate/20170524173850_add_guest_device_id_to_firmwares.rb @@ -0,0 +1,6 @@ +class AddGuestDeviceIdToFirmwares < ActiveRecord::Migration[5.0] + def change + add_column :firmwares, :guest_device_id, :bigint + add_index :firmwares, :guest_device_id, :name => "index_firmwares_on_guest_device_id" + end +end diff --git a/db/migrate/20170530180114_add_manufacturer_and_fru_to_guest_devices.rb b/db/migrate/20170530180114_add_manufacturer_and_fru_to_guest_devices.rb new file mode 100644 index 000000000..ecb53bebb --- /dev/null +++ b/db/migrate/20170530180114_add_manufacturer_and_fru_to_guest_devices.rb @@ -0,0 +1,8 @@ +class AddManufacturerAndFruToGuestDevices < ActiveRecord::Migration[5.0] + def change + add_column :guest_devices, :manufacturer, :string + add_column :guest_devices, :fru, :string + add_column :guest_devices, :guest_device_id, :bigint + add_index :guest_devices, :guest_device_id, :name => "index_guest_devices_on_guest_device_id" + end +end diff --git a/db/schema.yml b/db/schema.yml index 2b952528a..c590e98c1 100644 --- a/db/schema.yml +++ b/db/schema.yml @@ -1327,6 +1327,7 @@ firmwares: - resource_type - created_at - updated_at +- guest_device_id flavors: - id - ems_id @@ -1437,6 +1438,9 @@ guest_devices: - auto_detect - uid_ems - chap_auth_enabled +- manufacturer +- fru +- guest_device_id hardwares: - id - config_version From 675f39842e4912712ec90b6f119b85807e387474 Mon Sep 17 00:00:00 2001 From: skovic Date: Tue, 6 Jun 2017 09:25:52 -0400 Subject: [PATCH 2/6] Remove trailing whitespace in migration --- .../20170530180114_add_manufacturer_and_fru_to_guest_devices.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20170530180114_add_manufacturer_and_fru_to_guest_devices.rb b/db/migrate/20170530180114_add_manufacturer_and_fru_to_guest_devices.rb index ecb53bebb..0d65f0e53 100644 --- a/db/migrate/20170530180114_add_manufacturer_and_fru_to_guest_devices.rb +++ b/db/migrate/20170530180114_add_manufacturer_and_fru_to_guest_devices.rb @@ -3,6 +3,6 @@ def change add_column :guest_devices, :manufacturer, :string add_column :guest_devices, :fru, :string add_column :guest_devices, :guest_device_id, :bigint - add_index :guest_devices, :guest_device_id, :name => "index_guest_devices_on_guest_device_id" + add_index :guest_devices, :guest_device_id, :name => "index_guest_devices_on_guest_device_id" end end From f54c599c17d27d4dd149a36a6cf57c50b3e3b03d Mon Sep 17 00:00:00 2001 From: skovic Date: Wed, 14 Jun 2017 09:34:35 -0400 Subject: [PATCH 3/6] Rename fru to field_replaceable_unit --- .../20170530180114_add_manufacturer_and_fru_to_guest_devices.rb | 2 +- db/schema.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/db/migrate/20170530180114_add_manufacturer_and_fru_to_guest_devices.rb b/db/migrate/20170530180114_add_manufacturer_and_fru_to_guest_devices.rb index 0d65f0e53..66b3e7490 100644 --- a/db/migrate/20170530180114_add_manufacturer_and_fru_to_guest_devices.rb +++ b/db/migrate/20170530180114_add_manufacturer_and_fru_to_guest_devices.rb @@ -1,7 +1,7 @@ class AddManufacturerAndFruToGuestDevices < ActiveRecord::Migration[5.0] def change add_column :guest_devices, :manufacturer, :string - add_column :guest_devices, :fru, :string + add_column :guest_devices, :field_replaceable_unit, :string add_column :guest_devices, :guest_device_id, :bigint add_index :guest_devices, :guest_device_id, :name => "index_guest_devices_on_guest_device_id" end diff --git a/db/schema.yml b/db/schema.yml index c590e98c1..d421a24a3 100644 --- a/db/schema.yml +++ b/db/schema.yml @@ -1439,7 +1439,7 @@ guest_devices: - uid_ems - chap_auth_enabled - manufacturer -- fru +- field_replaceable_unit - guest_device_id hardwares: - id From 37751522e8ab90350c8f77bd07faec7eb0bef48f Mon Sep 17 00:00:00 2001 From: skovic Date: Fri, 16 Jun 2017 13:29:13 -0400 Subject: [PATCH 4/6] Rename guest_device_id to parent_device_id --- ...0170530180114_add_manufacturer_and_fru_to_guest_devices.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/db/migrate/20170530180114_add_manufacturer_and_fru_to_guest_devices.rb b/db/migrate/20170530180114_add_manufacturer_and_fru_to_guest_devices.rb index 66b3e7490..1e5029c6c 100644 --- a/db/migrate/20170530180114_add_manufacturer_and_fru_to_guest_devices.rb +++ b/db/migrate/20170530180114_add_manufacturer_and_fru_to_guest_devices.rb @@ -2,7 +2,7 @@ class AddManufacturerAndFruToGuestDevices < ActiveRecord::Migration[5.0] def change add_column :guest_devices, :manufacturer, :string add_column :guest_devices, :field_replaceable_unit, :string - add_column :guest_devices, :guest_device_id, :bigint - add_index :guest_devices, :guest_device_id, :name => "index_guest_devices_on_guest_device_id" + add_column :guest_devices, :parent_device_id, :bigint + add_index :guest_devices, :parent_device_id, :name => "index_guest_devices_on_parent_device_id" end end From f38024ba8381245216306ff95769beb03430e21b Mon Sep 17 00:00:00 2001 From: skovic Date: Wed, 21 Jun 2017 11:06:27 -0400 Subject: [PATCH 5/6] Update schema for parent_device_id --- db/schema.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/schema.yml b/db/schema.yml index d421a24a3..5f08a3ce9 100644 --- a/db/schema.yml +++ b/db/schema.yml @@ -1440,7 +1440,7 @@ guest_devices: - chap_auth_enabled - manufacturer - field_replaceable_unit -- guest_device_id +- parent_device_id hardwares: - id - config_version From 0d1ff8aa1072b18d2a1c250269b0a7977d8b3b7d Mon Sep 17 00:00:00 2001 From: skovic Date: Fri, 23 Jun 2017 14:34:25 -0400 Subject: [PATCH 6/6] Remove index names --- db/migrate/20170524173850_add_guest_device_id_to_firmwares.rb | 2 +- .../20170530180114_add_manufacturer_and_fru_to_guest_devices.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/db/migrate/20170524173850_add_guest_device_id_to_firmwares.rb b/db/migrate/20170524173850_add_guest_device_id_to_firmwares.rb index d7613768e..140d855c4 100644 --- a/db/migrate/20170524173850_add_guest_device_id_to_firmwares.rb +++ b/db/migrate/20170524173850_add_guest_device_id_to_firmwares.rb @@ -1,6 +1,6 @@ class AddGuestDeviceIdToFirmwares < ActiveRecord::Migration[5.0] def change add_column :firmwares, :guest_device_id, :bigint - add_index :firmwares, :guest_device_id, :name => "index_firmwares_on_guest_device_id" + add_index :firmwares, :guest_device_id end end diff --git a/db/migrate/20170530180114_add_manufacturer_and_fru_to_guest_devices.rb b/db/migrate/20170530180114_add_manufacturer_and_fru_to_guest_devices.rb index 1e5029c6c..ee81c56c9 100644 --- a/db/migrate/20170530180114_add_manufacturer_and_fru_to_guest_devices.rb +++ b/db/migrate/20170530180114_add_manufacturer_and_fru_to_guest_devices.rb @@ -3,6 +3,6 @@ def change add_column :guest_devices, :manufacturer, :string add_column :guest_devices, :field_replaceable_unit, :string add_column :guest_devices, :parent_device_id, :bigint - add_index :guest_devices, :parent_device_id, :name => "index_guest_devices_on_parent_device_id" + add_index :guest_devices, :parent_device_id end end