Disallow NULLs

This commit is contained in:
cryptogopher 2024-11-23 23:42:21 +01:00
parent f4ca1e91fa
commit f3751c5fa1

View File

@ -2,12 +2,12 @@ class CreateUnits < ActiveRecord::Migration[7.0]
def change
create_table :units do |t|
t.references :user, foreign_key: true
t.string :symbol
t.string :symbol, null: false
t.string :name
t.decimal :multiplier, precision: 30, scale: 15, default: 1.0
t.decimal :multiplier, null: false, precision: 30, scale: 15, default: 1.0
t.references :base
t.timestamps
t.timestamps null: false
end
add_index :units, [:user_id, :symbol], unique: true
end