Add Units

This commit is contained in:
2023-07-06 18:34:16 +02:00
parent 6f415dfb62
commit a4745c9cb8
21 changed files with 285 additions and 15 deletions

View File

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