Files
ubicloud/migrate/20230920_add_vm_created_at.rb
Enes Cakir 73ed952803 Add created_at column to Vm and VmHost
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.
2023-09-21 11:11:29 +03:00

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