mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-29 01:59:38 +02:00
14 lines
496 B
Ruby
14 lines
496 B
Ruby
|
class CreateBudgetCategories < ActiveRecord::Migration[7.2]
|
||
|
def change
|
||
|
create_table :budget_categories, id: :uuid do |t|
|
||
|
t.references :budget, null: false, foreign_key: true, type: :uuid
|
||
|
t.references :category, null: false, foreign_key: true, type: :uuid
|
||
|
t.decimal :budgeted_spending, null: false, precision: 19, scale: 4
|
||
|
t.string :currency, null: false
|
||
|
t.timestamps
|
||
|
end
|
||
|
|
||
|
add_index :budget_categories, %i[budget_id category_id], unique: true
|
||
|
end
|
||
|
end
|