initial sofurry impl
This commit is contained in:
@@ -20,7 +20,7 @@ Rails.application.configure do
|
||||
# Configure public file server for tests with Cache-Control for performance.
|
||||
config.public_file_server.enabled = true
|
||||
config.public_file_server.headers = {
|
||||
"Cache-Control" => "public, max-age=#{1.hour.to_i}"
|
||||
"Cache-Control" => "public, max-age=#{1.hour.to_i}",
|
||||
}
|
||||
|
||||
# Show full error reports and disable caching.
|
||||
|
||||
@@ -6,13 +6,14 @@ class ActiveRecord::Migration
|
||||
params(
|
||||
table_name: T.any(String, Symbol),
|
||||
column_name: T.any(String, Symbol),
|
||||
column_type: T.any(String, Symbol),
|
||||
options: T::Hash[Symbol, T.untyped],
|
||||
).void
|
||||
end
|
||||
def add_json_index(table_name, column_name, options = {})
|
||||
def add_json_index(table_name, column_name, column_type, options = {})
|
||||
add_index(
|
||||
table_name,
|
||||
"(json_attributes->>'#{column_name}')",
|
||||
"((json_attributes->>'#{column_name}')::#{column_type})",
|
||||
name: "idx_#{table_name}_on_#{column_name}",
|
||||
**options,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user