Auto-create check constraints for text fields with limit

Move column defaults from migration strategy to migrations.
Compact index creation inside migrations.
Disable database schema generation.
This commit is contained in:
2026-11-26 02:32:09 +01:00
parent 74f9a09098
commit b6d2c19b0b
9 changed files with 148 additions and 210 deletions
+1 -2
View File
@@ -1,11 +1,10 @@
class CreateUsers < ActiveRecord::Migration[8.1]
def change
create_table :users do |t|
t.string :email, null: false, limit: 64
t.string :email, null: false, limit: 2**6, index: {unique: true}
t.integer :status, null: false, default: 0
t.timestamps
end
add_index :users, :email
end
end