debian-mirror-gitlab/db/migrate/20210616134905_add_timestamp_to_schema_migration.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

16 lines
422 B
Ruby
Raw Normal View History

2021-09-30 23:02:18 +05:30
# frozen_string_literal: true
class AddTimestampToSchemaMigration < ActiveRecord::Migration[6.1]
def up
# Add a nullable column with default null first
add_column :schema_migrations, :finished_at, :timestamptz
# Change default to NOW() for new records
change_column_default :schema_migrations, :finished_at, -> { 'NOW()' }
end
def down
remove_column :schema_migrations, :finished_at
end
end