Skip to content

Commit

Permalink
Merge pull request #244 from fablabbcn/bugfix/populate_archived_at_co…
Browse files Browse the repository at this point in the history
…lumn

Populate archived_at field on devices for archived devices
  • Loading branch information
oscgonfer authored Jul 5, 2023
2 parents 6c768e3 + 8c45768 commit f25f8c1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
class PopulateDeviceArchivedAtColumn < ActiveRecord::Migration[6.0]
def change
execute %{
UPDATE devices
SET archived_at = NOW()
WHERE workflow_state = 'archived'
}
end
end
6 changes: 3 additions & 3 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2023_05_12_075843) do
ActiveRecord::Schema.define(version: 2023_07_05_095430) do

# These are extensions that must be enabled in order to support this database
enable_extension "adminpack"
Expand Down Expand Up @@ -89,8 +89,8 @@
t.string "state"
t.string "device_token"
t.jsonb "hardware_info"
t.datetime "notify_stopped_publishing_timestamp", default: "2019-01-16 16:19:35"
t.datetime "notify_low_battery_timestamp", default: "2019-01-16 16:19:35"
t.datetime "notify_stopped_publishing_timestamp", default: "2019-01-21 16:07:41"
t.datetime "notify_low_battery_timestamp", default: "2019-01-21 16:07:41"
t.boolean "notify_low_battery", default: false
t.boolean "notify_stopped_publishing", default: false
t.boolean "is_private", default: false
Expand Down

0 comments on commit f25f8c1

Please sign in to comment.