Simplify export unicity check and use create_or_find_by
This commit is contained in:
parent
b0e38f366e
commit
fd48b86b7f
6 changed files with 29 additions and 33 deletions
6
db/migrate/20210331123709_add_cache_key_to_exports.rb
Normal file
6
db/migrate/20210331123709_add_cache_key_to_exports.rb
Normal file
|
@ -0,0 +1,6 @@
|
|||
class AddCacheKeyToExports < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :exports, :key, :text
|
||||
add_index :exports, [:format, :key], unique: true
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue