prevent race conditions when creating archives
This commit is contained in:
parent
dfbe004122
commit
09870c918d
5 changed files with 23 additions and 13 deletions
6
db/migrate/20210427124500_add_key_to_archives.rb
Normal file
6
db/migrate/20210427124500_add_key_to_archives.rb
Normal file
|
@ -0,0 +1,6 @@
|
|||
class AddKeyToArchives < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
add_column :archives, :key, :text, null: false
|
||||
add_index :archives, [:key, :time_span_type, :month], unique: true
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue