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

Fixed conversion process from t.integer to t.bigint in mysql #354

Merged
merged 2 commits into from Apr 12, 2021

Conversation

pocari
Copy link
Contributor

@pocari pocari commented Apr 12, 2021

In the MySQL migration, "t.integer :column, limit: 8" was correctly converted to t.bigint, but the others were not supported, resulting in incorrect diffs.

I have converted limit:5, limit:6, and limit7 so that they are also converted to t.bigint.

% cat db/migrate/20210412031952_create_integer_test.rb
class CreateIntegerTest < ActiveRecord::Migration[6.1]
  def change
    create_table :integer_tests do |t|
      t.integer :integer4, limit: 4
      t.integer :integer5, limit: 5
      t.integer :integer6, limit: 6
      t.integer :integer7, limit: 7
      t.integer :integer8, limit: 8
    end
  end
end
% bin/rails db:migrate
== 20210412031952 CreateIntegerTest: migrating ================================
-- create_table(:integer_tests)
   -> 0.0402s
== 20210412031952 CreateIntegerTest: migrated (0.0403s) =======================

% git diff db/schema.rb
diff --git a/db/schema.rb b/db/schema.rb
index 81977b0..41eec75 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -10,7 +10,15 @@
 #
 # It's strongly recommended that you check this file into your version control system.

-ActiveRecord::Schema.define(version: 2021_03_07_041141) do
+ActiveRecord::Schema.define(version: 2021_04_12_031952) do
+
+  create_table "integer_tests", charset: "utf8mb4", collation: "utf8mb4_bin", force: :cascade do |t|
+    t.integer "integer4"
+    t.bigint "integer5"
+    t.bigint "integer6"
+    t.bigint "integer7"
+    t.bigint "integer8"
+  end

@winebarrel
Copy link
Collaborator

Thank you!

@winebarrel winebarrel merged commit cdb18a7 into ridgepole:0.9 Apr 12, 2021
@winebarrel
Copy link
Collaborator

v0.9.3 has been released.

@pocari pocari deleted the fix-mysql-convert-integer-by-limit branch May 5, 2021 04:41
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

Successfully merging this pull request may close these issues.

None yet

2 participants