Commit 26180cf7 authored by Patrick Bair's avatar Patrick Bair

Merge branch 'runner-token-expires-at' into 'master'

CI Runners: Add token expiration field

See merge request gitlab-org/gitlab!77899
parents 108b6e7e 874d5f80
# frozen_string_literal: true
class AddTokenExpiresAtToCiRunners < Gitlab::Database::Migration[1.0]
def change
add_column :ci_runners, :token_expires_at, :datetime_with_timezone
end
end
# frozen_string_literal: true
class AddIndexToCiRunnersTokenExpiresAt < Gitlab::Database::Migration[1.0]
disable_ddl_transaction!
def up
add_concurrent_index :ci_runners, [:token_expires_at, :id], order: { token_expires_at: :asc, id: :desc }, name: 'index_ci_runners_on_token_expires_at_and_id_desc'
add_concurrent_index :ci_runners, [:token_expires_at, :id], order: { token_expires_at: :desc, id: :desc }, name: 'index_ci_runners_on_token_expires_at_desc_and_id_desc'
end
def down
remove_concurrent_index_by_name :ci_runners, 'index_ci_runners_on_token_expires_at_desc_and_id_desc'
remove_concurrent_index_by_name :ci_runners, 'index_ci_runners_on_token_expires_at_and_id_desc'
end
end
4719c533acaac3234ac0e131c70be49d0f98642e29e7d2e31519cc6c372056bc
\ No newline at end of file
48d6eaa68912f702be2bd38609bea4fa807eab7131f7c5e2261416820df9836a
\ No newline at end of file
......@@ -12193,6 +12193,7 @@ CREATE TABLE ci_runners (
config jsonb DEFAULT '{}'::jsonb NOT NULL,
executor_type smallint,
maintainer_note text,
token_expires_at timestamp with time zone,
CONSTRAINT check_56f5ea8804 CHECK ((char_length(maintainer_note) <= 255))
);
......@@ -25733,6 +25734,10 @@ CREATE INDEX index_ci_runners_on_token ON ci_runners USING btree (token);
CREATE INDEX index_ci_runners_on_token_encrypted ON ci_runners USING btree (token_encrypted);
CREATE INDEX index_ci_runners_on_token_expires_at_and_id_desc ON ci_runners USING btree (token_expires_at, id DESC);
CREATE INDEX index_ci_runners_on_token_expires_at_desc_and_id_desc ON ci_runners USING btree (token_expires_at DESC, id DESC);
CREATE UNIQUE INDEX index_ci_running_builds_on_build_id ON ci_running_builds USING btree (build_id);
CREATE INDEX index_ci_running_builds_on_project_id ON ci_running_builds USING btree (project_id);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment