add timestamp to users roles table (#20844)

This commit is contained in:
Philip How 2024-04-09 19:25:51 +01:00 committed by GitHub
parent 31c982abba
commit ed837eb5b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 1 deletions

View file

@ -0,0 +1,5 @@
class AddTimestampsToUsersRolesTable < ActiveRecord::Migration[7.0]
def change
add_timestamps :users_roles, default: -> { 'CURRENT_TIMESTAMP' }
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.0].define(version: 2024_03_06_173309) do
ActiveRecord::Schema[7.0].define(version: 2024_04_08_101038) do
# These are extensions that must be enabled in order to support this database
enable_extension "citext"
enable_extension "ltree"
@ -1386,7 +1386,9 @@ ActiveRecord::Schema[7.0].define(version: 2024_03_06_173309) do
end
create_table "users_roles", id: false, force: :cascade do |t|
t.datetime "created_at", default: -> { "CURRENT_TIMESTAMP" }, null: false
t.bigint "role_id"
t.datetime "updated_at", default: -> { "CURRENT_TIMESTAMP" }, null: false
t.bigint "user_id"
t.index ["user_id", "role_id"], name: "index_users_roles_on_user_id_and_role_id"
end