<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -79,6 +79,7 @@ if ActiveRecord::Base.connection.supports_migrations?
       # Note: changed index name from &quot;key&quot; to &quot;key_idx&quot; since &quot;key&quot; is a Firebird reserved word
       # OpenBase does not have named indexes.  You must specify a single column name
       unless current_adapter?(:OpenBaseAdapter)
+        Person.update_all &quot;#{Person.connection.quote_column_name 'key'}=#{Person.connection.quote_column_name 'id'}&quot; #some databases (including sqlite2 won't add a unique index if existing data non unique)
         assert_nothing_raised { Person.connection.add_index(&quot;people&quot;, [&quot;key&quot;], :name =&gt; &quot;key_idx&quot;, :unique =&gt; true) }
         assert_nothing_raised { Person.connection.remove_index(&quot;people&quot;, :name =&gt; &quot;key_idx&quot;, :unique =&gt; true) }
       end</diff>
      <filename>activerecord/test/cases/migration_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>bf1b1e0925085811f0b58bb4093e678438ea0236</id>
    </parent>
  </parents>
  <author>
    <name>Frederick Cheung</name>
    <email>frederick.cheung@gmail.com</email>
  </author>
  <url>http://github.com/rails/rails/commit/ae51013c3f7b8a8579fcb99d889ed80e9dd75797</url>
  <id>ae51013c3f7b8a8579fcb99d889ed80e9dd75797</id>
  <committed-date>2008-04-22T19:24:20-07:00</committed-date>
  <authored-date>2008-04-22T19:23:53-07:00</authored-date>
  <message>Provide data for the key column otherwise adding a unique index will fail. [#30 state:closed]</message>
  <tree>fc347139364aead58aeaae74a915e71ac07b25d4</tree>
  <committer>
    <name>Michael Koziarski</name>
    <email>michael@koziarski.com</email>
  </committer>
</commit>
