Thanks to visit codestin.com
Credit goes to github.com

Skip to content

DB schema dumper uncompatibility in Rails 7.0 #43909

@mpg-tomohiko-mimura

Description

@mpg-tomohiko-mimura

Steps to reproduce

[email protected]:mito5525/precision_sample_app.git
cd precision_sample_app
bundle install

bin/rails db:drop db:create db:migrate
bin/rails db:schema:dump
git diff
# There is no difference.

bin/rails db:schema:load
bin/rails db:schema:dump
git diff

Expected behavior

No diffs in schema.rb

Actual behavior

The following differences will occur

diff --git a/db/schema.rb b/db/schema.rb
index 298ff3e..6d02e6b 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -13,7 +13,7 @@
 ActiveRecord::Schema.define(version: 2021_12_17_090228) do

   create_table "tasks", charset: "utf8mb4", force: :cascade do |t|
-    t.datetime "deleted_at"
+    t.datetime "deleted_at", precision: 6
     t.datetime "created_at", precision: 6, null: false
     t.datetime "updated_at", precision: 6, null: false
   end

I think there was a lack of compatibility considerations in #42297.

System configuration

Rails version: v7.0.0

Ruby version: v3.0.3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions