summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20200429181335_add_default_value_for_file_store_to_lfs_objects.rb19
-rw-r--r--db/migrate/20200429181955_add_default_value_for_file_store_to_ci_job_artifacts.rb19
-rw-r--r--db/migrate/20200429182245_add_default_value_for_store_to_uploads.rb19
-rw-r--r--db/structure.sql9
4 files changed, 63 insertions, 3 deletions
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 00000000000..f316a092bfc
--- /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 00000000000..ac3d5e41e3e
--- /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 00000000000..f28fcce8f2f
--- /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 73edcc371ce..e450a99eace 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
\.