Move migration defaults to ActiveRecord migration strategy

Remove redundant defaults
This commit is contained in:
2026-05-05 20:09:20 +02:00
parent 78639b4c1e
commit 4a36ffc8bf
7 changed files with 51 additions and 15 deletions

View File

@@ -1,4 +1,4 @@
class CreateQuantities < ActiveRecord::Migration[7.2]
class CreateQuantities < ActiveRecord::Migration[8.1]
def change
create_table :quantities do |t|
t.references :user, foreign_key: {on_delete: :cascade}
@@ -6,12 +6,12 @@ class CreateQuantities < ActiveRecord::Migration[7.2]
t.text :description
t.references :parent, foreign_key: {to_table: :quantities, on_delete: :cascade}
t.timestamps null: false
t.timestamps
# Caches; can be computed from other attributes
t.integer :depth, null: false, default: 0
t.string :pathname, null: false, limit: 511
end
add_index :quantities, [:user_id, :parent_id, :name], unique: true
add_index :quantities, [:user_id, :parent_id, :name]
end
end