ubicloud/migrate/20250915_add_github_custom_label.rb
Burak Velioglu 52da8d4e2e Add migration file for github custom labels
Adding the migration for github custom labels, which will keep
a custom label which can be used to have label-level limits.
2025-09-15 14:40:49 +03:00

17 lines
662 B
Ruby

# frozen_string_literal: true
Sequel.migration do
change do
create_table(:github_custom_label) do
column :id, :uuid, primary_key: true, default: Sequel.lit("gen_random_uuid()")
foreign_key :installation_id, :github_installation, type: :uuid, null: false
column :label, :text, null: false
column :alias_for, :text, null: false
column :concurrent_runner_count_limit, :integer, null: true
column :allocated_runner_count, :integer, null: false, default: 0
unique [:installation_id, :label]
constraint(:allocated_runner_count_limit) { allocated_runner_count <= concurrent_runner_count_limit }
end
end
end