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
0
Merge Requests
0
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
Jérome Perrin
gitlab-ce
Commits
8cca3282
Commit
8cca3282
authored
Feb 23, 2018
by
Andreas Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create user_contributed_projects table.
parent
49f72d06
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
0 deletions
+32
-0
db/migrate/20180223120443_create_user_contributed_projects_table.rb
.../20180223120443_create_user_contributed_projects_table.rb
+23
-0
db/schema.rb
db/schema.rb
+9
-0
No files found.
db/migrate/20180223120443_create_user_contributed_projects_table.rb
0 → 100644
View file @
8cca3282
class
CreateUserContributedProjectsTable
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
create_table
:user_contributed_projects
,
id:
false
do
|
t
|
t
.
references
:user
,
null:
false
t
.
references
:project
,
null:
false
t
.
index
[
:user_id
,
:project_id
],
unique:
true
end
add_concurrent_foreign_key
:user_contributed_projects
,
:users
,
column: :user_id
,
on_delete: :cascade
add_concurrent_foreign_key
:user_contributed_projects
,
:projects
,
column: :project_id
,
on_delete: :cascade
end
def
down
drop_table
:user_contributed_projects
end
end
db/schema.rb
View file @
8cca3282
...
...
@@ -1815,6 +1815,13 @@ ActiveRecord::Schema.define(version: 20180304204842) do
add_index
"user_callouts"
,
[
"user_id"
,
"feature_name"
],
name:
"index_user_callouts_on_user_id_and_feature_name"
,
unique:
true
,
using: :btree
add_index
"user_callouts"
,
[
"user_id"
],
name:
"index_user_callouts_on_user_id"
,
using: :btree
create_table
"user_contributed_projects"
,
id:
false
,
force: :cascade
do
|
t
|
t
.
integer
"user_id"
,
null:
false
t
.
integer
"project_id"
,
null:
false
end
add_index
"user_contributed_projects"
,
[
"user_id"
,
"project_id"
],
name:
"index_user_contributed_projects_on_user_id_and_project_id"
,
unique:
true
,
using: :btree
create_table
"user_custom_attributes"
,
force: :cascade
do
|
t
|
t
.
datetime_with_timezone
"created_at"
,
null:
false
t
.
datetime_with_timezone
"updated_at"
,
null:
false
...
...
@@ -2094,6 +2101,8 @@ ActiveRecord::Schema.define(version: 20180304204842) do
add_foreign_key
"trending_projects"
,
"projects"
,
on_delete: :cascade
add_foreign_key
"u2f_registrations"
,
"users"
add_foreign_key
"user_callouts"
,
"users"
,
on_delete: :cascade
add_foreign_key
"user_contributed_projects"
,
"projects"
,
name:
"fk_6fe26e92ae"
,
on_delete: :cascade
add_foreign_key
"user_contributed_projects"
,
"users"
,
name:
"fk_285db038d3"
,
on_delete: :cascade
add_foreign_key
"user_custom_attributes"
,
"users"
,
on_delete: :cascade
add_foreign_key
"user_synced_attributes_metadata"
,
"users"
,
on_delete: :cascade
add_foreign_key
"users_star_projects"
,
"projects"
,
name:
"fk_22cd27ddfc"
,
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