diff options
Diffstat (limited to 'activerecord/lib/active_record/internal_metadata.rb')
-rw-r--r-- | activerecord/lib/active_record/internal_metadata.rb | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/internal_metadata.rb b/activerecord/lib/active_record/internal_metadata.rb index 2e962f4218..e5c6e5c885 100644 --- a/activerecord/lib/active_record/internal_metadata.rb +++ b/activerecord/lib/active_record/internal_metadata.rb @@ -33,13 +33,12 @@ module ActiveRecord # Creates an internal metadata table with columns +key+ and +value+ def create_table unless table_exists? - connection.create_table(table_name, primary_key: :key, id: false ) do |t| + connection.create_table(table_name, id: false) do |t| t.column :key, :string t.column :value, :string t.timestamps + t.index :key, unique: true, name: index_name end - - connection.add_index table_name, :key, unique: true, name: index_name end end end |