Skip to content

Self-hosted project management for devs and their clients: tickets, time tracking, docs and meetings, with an AI assistant that cites its sources. AGPL-3.0.

554 B
Raw Blame
class AddBilledToTimeSessions < ActiveRecord::Migration[8.0]
  def change
    add_column :time_sessions, :billed, :boolean, default: false, null: false
    add_index :time_sessions, :billed
    
    # Datenmigration: Setze billed Status basierend auf TimeSessionGroup
    reversible do |dir|
      dir.up do
        execute <<-SQL
          UPDATE time_sessions 
          SET billed = true 
          WHERE time_session_group_id IN (
            SELECT id FROM time_session_groups WHERE billed = true
          )
        SQL
      end
    end
  end
end