Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Recreating the dummy app database yields different schema.rb #467

Closed
shouichi opened this issue Aug 11, 2021 · 2 comments
Closed

Recreating the dummy app database yields different schema.rb #467

shouichi opened this issue Aug 11, 2021 · 2 comments

Comments

@shouichi
Copy link
Contributor

Maybe not important or just me but here are the steps to reproduce and the diff.

host$ git rev-parse HEAD
0fc2bbe286890f6f228754eb3c9ba9cff126b7a6
host$ docker run --rm -it -v $PWD:/src ruby:2.7.4 bash
docker# cd /src
docker# bundle
docker# rake db:drop db:create db:migrate
docker# git diff
diff --git a/test/dummy/db/schema.rb b/test/dummy/db/schema.rb
index fdf74fc..5921297 100644
--- a/test/dummy/db/schema.rb
+++ b/test/dummy/db/schema.rb
@@ -16,7 +16,7 @@ ActiveRecord::Schema.define(version: 2021_05_17_131953) do
     t.string "name", null: false
     t.string "record_type", null: false
     t.integer "record_id", null: false
-    t.bigint "blob_id", null: false
+    t.integer "blob_id", null: false
     t.datetime "created_at", null: false
     t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
     t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
@@ -35,7 +35,7 @@ ActiveRecord::Schema.define(version: 2021_05_17_131953) do
   end
 
   create_table "active_storage_variant_records", force: :cascade do |t|
-    t.bigint "blob_id", null: false
+    t.integer "blob_id", null: false
     t.string "variation_digest", null: false
     t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
   end
@@ -56,7 +56,7 @@ ActiveRecord::Schema.define(version: 2021_05_17_131953) do
     t.datetime "created_at", precision: 6, null: false
     t.datetime "updated_at", precision: 6, null: false
     t.text "arguments"
-    t.index ["task_name", "created_at"], name: "index_maintenance_tasks_runs_on_task_name_and_created_at"
+    t.index ["task_name", "created_at"], name: "index_maintenance_tasks_runs_on_task_name_and_created_at", order: { created_at: :desc }
   end
 
   create_table "posts", force: :cascade do |t|
@adrianna-chang-shopify
Copy link
Contributor

adrianna-chang-shopify commented Aug 11, 2021

Hey @shouichi , thanks for the report! Unfortunately, both of these things are out of our control.

blob_id being converted to an integer is related to SQLite dumping bigint cols as integer columns, even for PK cols (see rails/rails#31329, #424)

The order being dropped on the maintenance_tasks_runs table is also a SQLite adapter bug (that should be fixed by rails/rails#41548 on Rails edge)

I don't think there's anything for us to do here, so I'm going to close this.

@shouichi
Copy link
Contributor Author

Thanks for the references, I learned a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants