Files
ubicloud/migrate/20231024_add_created_at.rb
Enes Cakir bdfb0a0fdd Add created_at column to various tables
The "created_at" field serves various purposes and proves particularly
useful during debugging. In case of breaking changes, it allows us to
adjust behavior based on the resource's age or decide which resources to
migrate based on their creation date.

It is good to see when a user registered, when a project was created, or
when an access tag was generated, as it indicates the association of a
user or resource with a project.
2023-10-24 08:33:29 +03:00

25 lines
833 B
Ruby

# frozen_string_literal: true
Sequel.migration do
change do
alter_table(:access_policy) do
add_column :created_at, :timestamptz, null: false, default: Sequel.lit("now()")
end
alter_table(:access_tag) do
add_column :created_at, :timestamptz, null: false, default: Sequel.lit("now()")
end
alter_table(:accounts) do
add_column :created_at, :timestamptz, null: false, default: Sequel.lit("now()")
end
alter_table(:billing_info) do
add_column :created_at, :timestamptz, null: false, default: Sequel.lit("now()")
end
alter_table(:payment_method) do
add_column :created_at, :timestamptz, null: false, default: Sequel.lit("now()")
end
alter_table(:project) do
add_column :created_at, :timestamptz, null: false, default: Sequel.lit("now()")
end
end
end