From f3751c5fa137be0d4eafbc455db7ce7e352f8f95 Mon Sep 17 00:00:00 2001 From: cryptogopher Date: Sat, 23 Nov 2024 23:42:21 +0100 Subject: [PATCH] Disallow NULLs --- db/migrate/20230602185352_create_units.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/db/migrate/20230602185352_create_units.rb b/db/migrate/20230602185352_create_units.rb index 9a91f6d..fb878b6 100644 --- a/db/migrate/20230602185352_create_units.rb +++ b/db/migrate/20230602185352_create_units.rb @@ -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