Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
6b4dfce8
Commit
6b4dfce8
authored
Sep 18, 2019
by
Aakriti Gupta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove commits table and store commit data per day
parent
b21156d5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
39 deletions
+5
-39
db/migrate/20190903150415_create_analytics_repository_commits_table.rb
...190903150415_create_analytics_repository_commits_table.rb
+0
-22
db/migrate/20190903150435_create_analytics_repository_file_edits_table.rb
...903150435_create_analytics_repository_file_edits_table.rb
+3
-5
db/schema.rb
db/schema.rb
+2
-12
No files found.
db/migrate/20190903150415_create_analytics_repository_commits_table.rb
deleted
100644 → 0
View file @
b21156d5
# frozen_string_literal: true
class
CreateAnalyticsRepositoryCommitsTable
<
ActiveRecord
::
Migration
[
5.2
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
def
change
create_table
:analytics_repository_commits
do
|
t
|
t
.
references
:project
,
index:
false
,
foreign_key:
{
on_delete: :cascade
},
null:
false
t
.
binary
:commit_sha
,
null:
false
t
.
datetime_with_timezone
:committed_at
,
null:
false
end
add_index
:analytics_repository_commits
,
[
:project_id
,
:commit_sha
],
unique:
true
end
end
db/migrate/20190903150435_create_analytics_repository_file_edits_table.rb
View file @
6b4dfce8
...
...
@@ -14,9 +14,7 @@ class CreateAnalyticsRepositoryFileEditsTable < ActiveRecord::Migration[5.2]
index:
false
,
foreign_key:
{
on_delete: :cascade
},
null:
false
t
.
references
:analytics_repository_commit
,
index:
{
name:
'index_analytics_repository_file_edits_on_commit_id'
},
foreign_key:
{
on_delete: :cascade
},
t
.
date
:committed_date
,
null:
false
t
.
integer
:num_edits
,
null:
false
,
...
...
@@ -24,8 +22,8 @@ class CreateAnalyticsRepositoryFileEditsTable < ActiveRecord::Migration[5.2]
end
add_index
:analytics_repository_file_edits
,
[
:analytics_repository_file_id
,
:
analytics_repository_commit_id
,
:project_id
],
name:
'index_
analytics_file_edits_on_commit_id
_file_id_and_project_id'
,
[
:analytics_repository_file_id
,
:
committed_date
,
:project_id
],
name:
'index_
file_edits_on_committed_date
_file_id_and_project_id'
,
unique:
true
end
end
db/schema.rb
View file @
6b4dfce8
...
...
@@ -93,20 +93,12 @@ ActiveRecord::Schema.define(version: 2019_09_14_223900) do
t
.
index
[
"project_id"
],
name:
"analytics_repository_languages_on_project_id"
end
create_table
"analytics_repository_commits"
,
force: :cascade
do
|
t
|
t
.
bigint
"project_id"
,
null:
false
t
.
binary
"commit_sha"
,
null:
false
t
.
datetime_with_timezone
"committed_at"
,
null:
false
t
.
index
[
"project_id"
,
"commit_sha"
],
name:
"index_analytics_repository_commits_on_project_id_and_commit_sha"
,
unique:
true
end
create_table
"analytics_repository_file_edits"
,
force: :cascade
do
|
t
|
t
.
bigint
"project_id"
,
null:
false
t
.
bigint
"analytics_repository_file_id"
,
null:
false
t
.
bigint
"analytics_repository_commit_id
"
,
null:
false
t
.
date
"committed_date
"
,
null:
false
t
.
integer
"num_edits"
,
default:
0
,
null:
false
t
.
index
[
"analytics_repository_commit_id"
],
name:
"index_analytics_repository_file_edits_on_commit_id"
t
.
index
[
"analytics_repository_file_id"
,
"analytics_repository_commit_id"
,
"project_id"
],
name:
"index_analytics_file_edits_on_commit_id_file_id_and_project_id"
,
unique:
true
t
.
index
[
"analytics_repository_file_id"
,
"committed_date"
,
"project_id"
],
name:
"index_file_edits_on_committed_date_file_id_and_project_id"
,
unique:
true
t
.
index
[
"project_id"
],
name:
"index_analytics_repository_file_edits_on_project_id"
end
...
...
@@ -3811,8 +3803,6 @@ ActiveRecord::Schema.define(version: 2019_09_14_223900) do
add_foreign_key
"analytics_cycle_analytics_project_stages"
,
"projects"
,
on_delete: :cascade
add_foreign_key
"analytics_language_trend_repository_languages"
,
"programming_languages"
,
on_delete: :cascade
add_foreign_key
"analytics_language_trend_repository_languages"
,
"projects"
,
on_delete: :cascade
add_foreign_key
"analytics_repository_commits"
,
"projects"
,
on_delete: :cascade
add_foreign_key
"analytics_repository_file_edits"
,
"analytics_repository_commits"
,
on_delete: :cascade
add_foreign_key
"analytics_repository_file_edits"
,
"analytics_repository_files"
,
on_delete: :cascade
add_foreign_key
"analytics_repository_file_edits"
,
"projects"
,
on_delete: :cascade
add_foreign_key
"analytics_repository_files"
,
"projects"
,
on_delete: :cascade
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment