diff --git a/db/migrate/20220114110920_update_order_cycle_mails.rb b/db/migrate/20220114110920_update_order_cycle_mails.rb new file mode 100644 index 0000000000..aa4fef0d6f --- /dev/null +++ b/db/migrate/20220114110920_update_order_cycle_mails.rb @@ -0,0 +1,12 @@ +class UpdateOrderCycleMails < ActiveRecord::Migration[6.1] + class MigrationOrderCycle < ActiveRecord::Base + self.table_name = "order_cycles" + end + + def up + MigrationOrderCycle. + where(automatic_notifications: true). + where.not(processed_at: nil). + update_all(mails_sent: true) + end +end diff --git a/db/schema.rb b/db/schema.rb index 5a1d641eee..d3ec898e90 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2022_01_12_102539) do +ActiveRecord::Schema.define(version: 2022_01_14_110920) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql"