class CreateSubscriptions < ActiveRecord::Migration[6.1] def change create_table :subscriptions do |t| t.string :contact t.integer :licenses_count t.string :name t.string :supplier_name t.string :industry_name t.string :product_name t.integer :licese_type t.integer :max_users t.date :starts_at t.date :ends_at t.integer :active_licenses_count t.text :notes t.boolean :is_autorenew t.integer :autorenew_duration t.string :autorenew_duration_unit, :duration_unit, null: false, default: 'month' t.date :autorenew_deadline t.string :billing_frequency t.string :contract_entity_name t.date :autorenew_voided_at t.date :renewed_at t.decimal :retention, precision: 17, scale: 2, null: true t.string :limit t.integer :retention_currency_id t.boolean :has_percentage_discount_type t.boolean :has_flat_fare_discount_type t.timestamps end end end