-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #345 from blackcandy-org/solid-cache
Replace litecache with solid_cache
- Loading branch information
Showing
10 changed files
with
64 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
db/migrate/20240202024630_create_solid_cache_entries.solid_cache.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# This migration comes from solid_cache (originally 20230724121448) | ||
class CreateSolidCacheEntries < ActiveRecord::Migration[7.0] | ||
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.index :key, unique: true | ||
end | ||
end | ||
end |
9 changes: 9 additions & 0 deletions
9
db/migrate/20240202024631_add_key_hash_and_byte_size_to_solid_cache_entries.solid_cache.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# This migration comes from solid_cache (originally 20240108155507) | ||
class AddKeyHashAndByteSizeToSolidCacheEntries < ActiveRecord::Migration[7.1] | ||
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 |
12 changes: 12 additions & 0 deletions
12
...key_hash_and_byte_size_indexes_and_null_constraints_to_solid_cache_entries.solid_cache.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# This migration comes from solid_cache (originally 20240110111600) | ||
class AddKeyHashAndByteSizeIndexesAndNullConstraintsToSolidCacheEntries < ActiveRecord::Migration[7.1] | ||
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 |
8 changes: 8 additions & 0 deletions
8
db/migrate/20240202024633_remove_key_index_from_solid_cache_entries.solid_cache.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# This migration comes from solid_cache (originally 20240110111702) | ||
class RemoveKeyIndexFromSolidCacheEntries < ActiveRecord::Migration[7.1] | ||
def change | ||
change_table :solid_cache_entries do |t| | ||
t.remove_index :key, unique: true | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters