Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

683 B
Raw Blame
# frozen_string_literal: true
class CreateScheduledMeetings < ActiveRecord::Migration[7.1]
  def change
    create_table :scheduled_meetings do |t|
      t.belongs_to :recurring_meeting,
                   null: false,
                   foreign_key: { index: true, on_delete: :cascade }

      t.belongs_to :meeting,
                   null: true,
                   foreign_key: { index: true, unique: true, on_delete: :nullify }

      t.datetime :start_time, null: false
      t.boolean :cancelled, default: false, null: false

      t.timestamps
    end

    add_index :scheduled_meetings,
              %i[recurring_meeting_id start_time],
              unique: true
  end
end