[Ovirt-devel] Re: [PATCH server] BUG#467099: Fixes a uniqueness constraint bug in bondings_nics.

Darryl Pierce dpierce at redhat.com
Fri Oct 24 12:47:59 UTC 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Darryl L. Pierce wrote:
> It moves the uniqueness constraint from being on the pair (bonding_id, nic_id)
> to being only on nic_id. The goal is just to ensure that a nic is only mapped
> once to any bonding.
> 
> You will need to run a migration with this patch.
> 
> Signed-off-by: Darryl L. Pierce <dpierce at redhat.com>
> ---
>  ...ll.rb => 026_allow_nic_boot_type_to_be_null.rb} |    0 
>  ..._fix_uniqueness_constraints_in_bondings_nics.rb |   11 +++++++++++
>  2 files changed, 11 insertions(+), 0 deletions(-)
>  rename src/db/migrate/{025_allow_nic_boot_type_to_be_null.rb => 026_allow_nic_boot_type_to_be_null.rb} (100%)
>  create mode 100644 src/db/migrate/027_fix_uniqueness_constraints_in_bondings_nics.rb
> 
> diff --git a/src/db/migrate/025_allow_nic_boot_type_to_be_null.rb b/src/db/migrate/026_allow_nic_boot_type_to_be_null.rb
> similarity index 100%
> rename from src/db/migrate/025_allow_nic_boot_type_to_be_null.rb
> rename to src/db/migrate/026_allow_nic_boot_type_to_be_null.rb
> diff --git a/src/db/migrate/027_fix_uniqueness_constraints_in_bondings_nics.rb b/src/db/migrate/027_fix_uniqueness_constraints_in_bondings_nics.rb
> new file mode 100644
> index 0000000..0daa210
> --- /dev/null
> +++ b/src/db/migrate/027_fix_uniqueness_constraints_in_bondings_nics.rb
> @@ -0,0 +1,11 @@
> +class FixUniquenessConstraintsInBondingsNics < ActiveRecord::Migration
> +  def self.up
> +    remove_index :bondings_nics, [:bonding_id, :nic_id]
> +    add_index :bondings_nics, :nic_id, :unique => true
> +  end
> +
> +  def self.down
> +    remove_index :bondings_nics, :nic_id
> +    add_index :bondings_nics, [:bonding_id, :nic_id], :unique => true
> +  end
> +end

It's a small patch, can someone review it and give feedback or an ACK?


- --
Darryl L. Pierce <dpierce at redhat.com> : GPG KEYID: 6C4E7F1B
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkkBw/0ACgkQjaT4DmxOfxsfGQCgqmbIHJljjUxroCDFh17dgGiY
lT8An3maXvHYlPHa+8a58Kr4ear9JSpx
=8TxV
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dpierce.vcf
Type: text/x-vcard
Size: 319 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/ovirt-devel/attachments/20081024/c31746ab/attachment.vcf>


More information about the ovirt-devel mailing list