diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 07:08:36 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 07:08:36 +0000 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /db/migrate/20200813135558_create_ci_deleted_objects.rb | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) | |
download | gitlab-ce-48aff82709769b098321c738f3444b9bdaa694c6.tar.gz |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'db/migrate/20200813135558_create_ci_deleted_objects.rb')
-rw-r--r-- | db/migrate/20200813135558_create_ci_deleted_objects.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/db/migrate/20200813135558_create_ci_deleted_objects.rb b/db/migrate/20200813135558_create_ci_deleted_objects.rb new file mode 100644 index 00000000000..5364b7fc0ce --- /dev/null +++ b/db/migrate/20200813135558_create_ci_deleted_objects.rb @@ -0,0 +1,29 @@ +# frozen_string_literal: true + +class CreateCiDeletedObjects < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + disable_ddl_transaction! + + def up + create_table :ci_deleted_objects, if_not_exists: true do |t| + t.integer :file_store, limit: 2, default: 1, null: false + t.datetime_with_timezone :pick_up_at, null: false, default: -> { 'now()' }, index: true + t.text :store_dir, null: false + + # rubocop:disable Migration/AddLimitToTextColumns + # This column depends on the `file` column from `ci_job_artifacts` table + # which doesn't have a constraint limit on it. + t.text :file, null: false + # rubocop:enable Migration/AddLimitToTextColumns + end + + add_text_limit(:ci_deleted_objects, :store_dir, 1024) + end + + def down + drop_table :ci_deleted_objects + end +end |