summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-23 18:09:25 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-23 18:09:25 +0000
commit967812838c7e7742729a4c7aeb9859f98a509622 (patch)
tree22db2e6642be51cb12535db7863331457e5523c3 /db
parent074d013e1eb3f6e0c27f96a3be8b9361254c8a98 (diff)
downloadgitlab-ce-967812838c7e7742729a4c7aeb9859f98a509622.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20200316162648_add_index_on_namespace_id_and_id_to_projects.rb19
-rw-r--r--db/migrate/20200323075043_add_max_personal_access_token_lifetime_to_namespaces.rb19
-rw-r--r--db/structure.sql9
3 files changed, 44 insertions, 3 deletions
diff --git a/db/migrate/20200316162648_add_index_on_namespace_id_and_id_to_projects.rb b/db/migrate/20200316162648_add_index_on_namespace_id_and_id_to_projects.rb
new file mode 100644
index 00000000000..96fbab1e2ea
--- /dev/null
+++ b/db/migrate/20200316162648_add_index_on_namespace_id_and_id_to_projects.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddIndexOnNamespaceIdAndIdToProjects < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index :projects, [:namespace_id, :id]
+ remove_concurrent_index :projects, :namespace_id
+ end
+
+ def down
+ add_concurrent_index :projects, :namespace_id
+ remove_concurrent_index :projects, [:namespace_id, :id]
+ end
+end
diff --git a/db/migrate/20200323075043_add_max_personal_access_token_lifetime_to_namespaces.rb b/db/migrate/20200323075043_add_max_personal_access_token_lifetime_to_namespaces.rb
new file mode 100644
index 00000000000..907c832ce46
--- /dev/null
+++ b/db/migrate/20200323075043_add_max_personal_access_token_lifetime_to_namespaces.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class AddMaxPersonalAccessTokenLifetimeToNamespaces < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+
+ def up
+ with_lock_retries do
+ add_column :namespaces, :max_personal_access_token_lifetime, :integer
+ end
+ end
+
+ def down
+ with_lock_retries do
+ remove_column :namespaces, :max_personal_access_token_lifetime
+ end
+ end
+end
diff --git a/db/structure.sql b/db/structure.sql
index 2af6dcba3fd..e5d28e499f9 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -3944,7 +3944,8 @@ CREATE TABLE public.namespaces (
max_artifacts_size integer,
mentions_disabled boolean,
default_branch_protection smallint,
- unlock_membership_to_ldap boolean
+ unlock_membership_to_ldap boolean,
+ max_personal_access_token_lifetime integer
);
CREATE SEQUENCE public.namespaces_id_seq
@@ -9656,7 +9657,7 @@ CREATE INDEX index_projects_on_name_and_id ON public.projects USING btree (name,
CREATE INDEX index_projects_on_name_trigram ON public.projects USING gin (name public.gin_trgm_ops);
-CREATE INDEX index_projects_on_namespace_id ON public.projects USING btree (namespace_id);
+CREATE INDEX index_projects_on_namespace_id_and_id ON public.projects USING btree (namespace_id, id);
CREATE INDEX index_projects_on_path_and_id ON public.projects USING btree (path, id);
@@ -12701,6 +12702,7 @@ INSERT INTO "schema_migrations" (version) VALUES
('20200313101649'),
('20200313123934'),
('20200316111759'),
+('20200316162648'),
('20200316173312'),
('20200317142110'),
('20200318152134'),
@@ -12708,5 +12710,6 @@ INSERT INTO "schema_migrations" (version) VALUES
('20200318163148'),
('20200318164448'),
('20200318165448'),
-('20200319203901');
+('20200319203901'),
+('20200323075043');