Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-09-20 14:18:08 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-09-20 14:18:08 +0300
commit5afcbe03ead9ada87621888a31a62652b10a7e4f (patch)
tree9918b67a0d0f0bafa6542e839a8be37adf73102d /db/migrate/20230905234949_create_groups_visits_tables.rb
parentc97c0201564848c1f53226fe19d71fdcc472f7d0 (diff)
Add latest changes from gitlab-org/gitlab@16-4-stable-eev16.4.0-rc42
Diffstat (limited to 'db/migrate/20230905234949_create_groups_visits_tables.rb')
-rw-r--r--db/migrate/20230905234949_create_groups_visits_tables.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/db/migrate/20230905234949_create_groups_visits_tables.rb b/db/migrate/20230905234949_create_groups_visits_tables.rb
new file mode 100644
index 00000000000..f02e6e64220
--- /dev/null
+++ b/db/migrate/20230905234949_create_groups_visits_tables.rb
@@ -0,0 +1,19 @@
+# frozen_string_literal: true
+
+class CreateGroupsVisitsTables < Gitlab::Database::Migration[2.1]
+ def up
+ create_table :groups_visits, primary_key: [:id, :visited_at],
+ options: 'PARTITION BY RANGE (visited_at)' do |t|
+ t.bigserial :id, null: false
+ t.bigint :entity_id, null: false, index: true
+ t.bigint :user_id, null: false
+ t.datetime_with_timezone :visited_at, null: false
+ end
+
+ add_index(:groups_visits, [:user_id, :entity_id, :visited_at])
+ end
+
+ def down
+ drop_table :groups_visits
+ end
+end