The "created_at" field is a useful property for various reasons. It's particularly beneficial during debugging. Moreover, in the event of breaking changes, we can modify behavior based on the age of the resource, or decide which resources to migrate based on their creation date. Additionally, we don't display virtual machines in any specific order. The order is arbitrary, determined by PostgreSQL. However, I have now changed it to display from the newest to the oldest, top to bottom.
13 lines
314 B
Ruby
13 lines
314 B
Ruby
# frozen_string_literal: true
|
|
|
|
Sequel.migration do
|
|
change do
|
|
alter_table(:vm) do
|
|
add_column :created_at, :timestamptz, null: false, default: Sequel.lit("now()")
|
|
end
|
|
alter_table(:vm_host) do
|
|
add_column :created_at, :timestamptz, null: false, default: Sequel.lit("now()")
|
|
end
|
|
end
|
|
end
|