-
Notifications
You must be signed in to change notification settings - Fork 22.1k
Open
Description
Steps to reproduce
schema.rb
create_table "users", id: false, force: :cascade do |t|
t.binary "id", limit: 16, null: false, primary_key: true
# OR: t.binary "id", limit: 16, null: false, primary_key: true, type: "BINARY(16)" # This addition does not change anything
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
endOR (yields the same result):
create_table "users", id: { type: :binary, limit: 16 }, force: :cascade do |t|
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
endCreate the tables
$ bin/rails db:schema:load
Expected behavior
Column Users.id should be of type BINARY(16).
Actual behavior
Column Users.id is of type VARBINARY(16).
Even if one monkey-patches the situation by running migrations containing raw SQL, to get to the correct data type: The schema.rb will always remain the same (since it's auto-generated by Rails), meaning that it can never be "loaded" (used to create the DB tables). So there is still no solution.
(Also: I see that Rails still ignores MariaDB regarding UUID support - does the Rails Core Team discourage the use of MariaDB for some reason? If so, why? I consider it to be superior to MySQL.)
System configuration
Rails version: Rails 7.2.3
Ruby version: ruby 3.4.7
Database version: mariadb from 12.1.1-MariaDB, client 15.2 for debian-linux-gnu (x86_64)
Metadata
Metadata
Assignees
Labels
No labels