forked from fixin.me/fixin.me
Add Units
This commit is contained in:
19
db/migrate/20230602185352_create_units.rb
Normal file
19
db/migrate/20230602185352_create_units.rb
Normal 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
|
||||
Reference in New Issue
Block a user