diff --git a/db/migrate/20230724121448_create_solid_cache_entries.rb b/db/migrate/20230724121448_create_solid_cache_entries.rb index 82749d9..a08ea15 100644 --- a/db/migrate/20230724121448_create_solid_cache_entries.rb +++ b/db/migrate/20230724121448_create_solid_cache_entries.rb @@ -1,11 +1,15 @@ -class CreateSolidCacheEntries < ActiveRecord::Migration[7.0] +class CreateSolidCacheEntries < ActiveRecord::Migration[7.2] def change create_table :solid_cache_entries do |t| t.binary :key, null: false, limit: 1024 t.binary :value, null: false, limit: 512.megabytes t.datetime :created_at, null: false + t.integer :key_hash, null: false, limit: 8 + t.integer :byte_size, null: false, limit: 4 - t.index :key, unique: true + t.index :key_hash, unique: true + t.index [:key_hash, :byte_size] + t.index :byte_size end end end diff --git a/db/migrate/20240108155507_add_key_hash_and_byte_size_to_solid_cache_entries.rb b/db/migrate/20240108155507_add_key_hash_and_byte_size_to_solid_cache_entries.rb deleted file mode 100644 index 871d5b9..0000000 --- a/db/migrate/20240108155507_add_key_hash_and_byte_size_to_solid_cache_entries.rb +++ /dev/null @@ -1,8 +0,0 @@ -class AddKeyHashAndByteSizeToSolidCacheEntries < ActiveRecord::Migration[7.0] - def change - change_table :solid_cache_entries do |t| - t.column :key_hash, :integer, null: true, limit: 8 - t.column :byte_size, :integer, null: true, limit: 4 - end - end -end diff --git a/db/migrate/20240110111600_add_key_hash_and_byte_size_indexes_and_null_constraints_to_solid_cache_entries.rb b/db/migrate/20240110111600_add_key_hash_and_byte_size_indexes_and_null_constraints_to_solid_cache_entries.rb deleted file mode 100644 index a0662ec..0000000 --- a/db/migrate/20240110111600_add_key_hash_and_byte_size_indexes_and_null_constraints_to_solid_cache_entries.rb +++ /dev/null @@ -1,11 +0,0 @@ -class AddKeyHashAndByteSizeIndexesAndNullConstraintsToSolidCacheEntries < ActiveRecord::Migration[7.0] - def change - change_table :solid_cache_entries, bulk: true do |t| - t.change_null :key_hash, false - t.change_null :byte_size, false - t.index :key_hash, unique: true - t.index [:key_hash, :byte_size] - t.index :byte_size - end - end -end diff --git a/db/migrate/20240110111702_remove_key_index_from_solid_cache_entries.rb b/db/migrate/20240110111702_remove_key_index_from_solid_cache_entries.rb deleted file mode 100644 index 975834b..0000000 --- a/db/migrate/20240110111702_remove_key_index_from_solid_cache_entries.rb +++ /dev/null @@ -1,7 +0,0 @@ -class RemoveKeyIndexFromSolidCacheEntries < ActiveRecord::Migration[7.0] - def change - change_table :solid_cache_entries do |t| - t.remove_index :key, unique: true - end - end -end