# Ruby Calculator - Interactive calculator built with Ruby on Rails
# Author: RSK World (Molla Samser, Founder | Rima Khatun, Designer & Tester)
# Contact: help@rskworld.in | +91 93305 39277
# Website: https://rskworld.in
# Year: 2026
# Description: Build a fully functional calculator using Ruby on Rails with modern UI

class CreateFavoriteCalculations < ActiveRecord::Migration[7.0]
  def change
    create_table :favorite_calculations do |t|
      t.string :name, null: false
      t.text :expression, null: false
      t.float :result, null: false
      t.string :category, null: false, default: 'custom'
      t.text :description
      t.references :calculation_history, null: true, foreign_key: true
      t.timestamps
    end
    
    add_index :favorite_calculations, :name
    add_index :favorite_calculations, :category
    add_index :favorite_calculations, :created_at
  end
end
