prevent race conditions when creating archives

This commit is contained in:
Christophe Robillard 2021-04-27 18:57:13 +02:00
parent dfbe004122
commit 09870c918d
5 changed files with 23 additions and 13 deletions

View 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