-
Notifications
You must be signed in to change notification settings - Fork 360
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add last_status_change to deployments object
* indicates last time status.reason or status.value was updated * status_updated_at column is set to updated_at for exisiting deployments. Unfortunately updated_at is nullable, so those with null updated_at (unclear if this is a real scenario) will have status_updated_at set to the current time Co-authored-by: Joao Pereira <[email protected]> Co-authored-by: Seth Boyles <[email protected]>
- Loading branch information
1 parent
7494b94
commit c3ab524
Showing
7 changed files
with
106 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
db/migrations/20240709234116_add_status_updated_at_to_deployments.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
Sequel.migration do | ||
up do | ||
alter_table(:deployments) do | ||
add_column :status_updated_at, DateTime, default: Sequel::CURRENT_TIMESTAMP, null: false | ||
end | ||
run 'update deployments set status_updated_at = updated_at where updated_at is not null' | ||
end | ||
|
||
down do | ||
alter_table(:deployments) do | ||
drop_column :status_updated_at | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters