diff --git a/db/migrate/20200429181335_add_default_value_for_file_store_to_lfs_objects.rb b/db/migrate/20200429181335_add_default_value_for_file_store_to_lfs_objects.rb new file mode 100644 index 0000000000000000000000000000000000000000..f316a092bfca3680f33a10f0df28b1cbc0ea9e74 --- /dev/null +++ b/db/migrate/20200429181335_add_default_value_for_file_store_to_lfs_objects.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddDefaultValueForFileStoreToLfsObjects < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def up + with_lock_retries do + change_column_default :lfs_objects, :file_store, 1 + end + end + + def down + with_lock_retries do + change_column_default :lfs_objects, :file_store, nil + end + end +end diff --git a/db/migrate/20200429181955_add_default_value_for_file_store_to_ci_job_artifacts.rb b/db/migrate/20200429181955_add_default_value_for_file_store_to_ci_job_artifacts.rb new file mode 100644 index 0000000000000000000000000000000000000000..ac3d5e41e3ebe1b41f9eb6ab3e3c61a0fc883d91 --- /dev/null +++ b/db/migrate/20200429181955_add_default_value_for_file_store_to_ci_job_artifacts.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddDefaultValueForFileStoreToCiJobArtifacts < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def up + with_lock_retries do + change_column_default :ci_job_artifacts, :file_store, 1 + end + end + + def down + with_lock_retries do + change_column_default :ci_job_artifacts, :file_store, nil + end + end +end diff --git a/db/migrate/20200429182245_add_default_value_for_store_to_uploads.rb b/db/migrate/20200429182245_add_default_value_for_store_to_uploads.rb new file mode 100644 index 0000000000000000000000000000000000000000..f28fcce8f2f34aec4b93dc8c88ac54a7b27bd637 --- /dev/null +++ b/db/migrate/20200429182245_add_default_value_for_store_to_uploads.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +class AddDefaultValueForStoreToUploads < ActiveRecord::Migration[6.0] + include Gitlab::Database::MigrationHelpers + + DOWNTIME = false + + def up + with_lock_retries do + change_column_default :uploads, :store, 1 + end + end + + def down + with_lock_retries do + change_column_default :uploads, :store, nil + end + end +end diff --git a/db/structure.sql b/db/structure.sql index 73edcc371ce6027c42cb93a612e8742c35844249..e450a99eace6e308a1d1843578b7d95fa82b3024 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -1120,7 +1120,7 @@ CREATE TABLE public.ci_job_artifacts ( updated_at timestamp with time zone NOT NULL, expire_at timestamp with time zone, file character varying, - file_store integer, + file_store integer DEFAULT 1, file_sha256 bytea, file_format smallint, file_location smallint, @@ -3644,7 +3644,7 @@ CREATE TABLE public.lfs_objects ( created_at timestamp without time zone, updated_at timestamp without time zone, file character varying, - file_store integer + file_store integer DEFAULT 1 ); CREATE SEQUENCE public.lfs_objects_id_seq @@ -6487,7 +6487,7 @@ CREATE TABLE public.uploads ( model_type character varying, uploader character varying NOT NULL, created_at timestamp without time zone NOT NULL, - store integer, + store integer DEFAULT 1, mount_point character varying, secret character varying ); @@ -13706,5 +13706,8 @@ COPY "schema_migrations" (version) FROM STDIN; 20200424101920 20200427064130 20200429015603 +20200429181335 +20200429181955 +20200429182245 \.