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
10c0cb8c
Commit
10c0cb8c
authored
Mar 13, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add migration for already imported projects
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
44c94039
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
42 deletions
+53
-42
db/migrate/20140313092127_migrate_already_imported_projects.rb
...grate/20140313092127_migrate_already_imported_projects.rb
+12
-0
db/schema.rb
db/schema.rb
+41
-42
No files found.
db/migrate/20140313092127_migrate_already_imported_projects.rb
0 → 100644
View file @
10c0cb8c
class
MigrateAlreadyImportedProjects
<
ActiveRecord
::
Migration
def
up
Project
.
where
(
imported:
true
).
update_all
(
import_status:
"finished"
)
Project
.
where
(
imported:
false
).
update_all
(
import_status:
"none"
)
remove_column
:projects
,
:imported
end
def
down
add_column
:projects
,
:imported
,
:boolean
,
default:
false
Project
.
where
(
import_status:
'finished'
).
update_all
(
imported:
true
)
end
end
db/schema.rb
View file @
10c0cb8c
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2014031
214535
7
)
do
ActiveRecord
::
Schema
.
define
(
version:
2014031
309212
7
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
@@ -21,8 +21,8 @@ ActiveRecord::Schema.define(version: 20140312145357) do
t
.
datetime
"starts_at"
t
.
datetime
"ends_at"
t
.
integer
"alert_type"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
string
"color"
t
.
string
"font"
end
...
...
@@ -30,8 +30,8 @@ ActiveRecord::Schema.define(version: 20140312145357) do
create_table
"deploy_keys_projects"
,
force:
true
do
|
t
|
t
.
integer
"deploy_key_id"
,
null:
false
t
.
integer
"project_id"
,
null:
false
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
end
add_index
"deploy_keys_projects"
,
[
"project_id"
],
name:
"index_deploy_keys_projects_on_project_id"
,
using: :btree
...
...
@@ -52,8 +52,8 @@ ActiveRecord::Schema.define(version: 20140312145357) do
t
.
string
"title"
t
.
text
"data"
t
.
integer
"project_id"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
integer
"action"
t
.
integer
"author_id"
end
...
...
@@ -68,8 +68,8 @@ ActiveRecord::Schema.define(version: 20140312145357) do
create_table
"forked_project_links"
,
force:
true
do
|
t
|
t
.
integer
"forked_to_project_id"
,
null:
false
t
.
integer
"forked_from_project_id"
,
null:
false
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
end
add_index
"forked_project_links"
,
[
"forked_to_project_id"
],
name:
"index_forked_project_links_on_forked_to_project_id"
,
unique:
true
,
using: :btree
...
...
@@ -79,8 +79,8 @@ ActiveRecord::Schema.define(version: 20140312145357) do
t
.
integer
"assignee_id"
t
.
integer
"author_id"
t
.
integer
"project_id"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
integer
"position"
,
default:
0
t
.
string
"branch_name"
t
.
text
"description"
...
...
@@ -98,8 +98,8 @@ ActiveRecord::Schema.define(version: 20140312145357) do
create_table
"keys"
,
force:
true
do
|
t
|
t
.
integer
"user_id"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
text
"key"
t
.
string
"title"
t
.
string
"type"
...
...
@@ -126,8 +126,8 @@ ActiveRecord::Schema.define(version: 20140312145357) do
t
.
integer
"author_id"
t
.
integer
"assignee_id"
t
.
string
"title"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
integer
"milestone_id"
t
.
string
"state"
t
.
string
"merge_status"
...
...
@@ -141,7 +141,7 @@ ActiveRecord::Schema.define(version: 20140312145357) do
add_index
"merge_requests"
,
[
"created_at"
],
name:
"index_merge_requests_on_created_at"
,
using: :btree
add_index
"merge_requests"
,
[
"milestone_id"
],
name:
"index_merge_requests_on_milestone_id"
,
using: :btree
add_index
"merge_requests"
,
[
"source_branch"
],
name:
"index_merge_requests_on_source_branch"
,
using: :btree
add_index
"merge_requests"
,
[
"source_project_id"
],
name:
"index_merge_requests_on_
source_
project_id"
,
using: :btree
add_index
"merge_requests"
,
[
"source_project_id"
],
name:
"index_merge_requests_on_project_id"
,
using: :btree
add_index
"merge_requests"
,
[
"target_branch"
],
name:
"index_merge_requests_on_target_branch"
,
using: :btree
add_index
"merge_requests"
,
[
"title"
],
name:
"index_merge_requests_on_title"
,
using: :btree
...
...
@@ -150,8 +150,8 @@ ActiveRecord::Schema.define(version: 20140312145357) do
t
.
integer
"project_id"
,
null:
false
t
.
text
"description"
t
.
date
"due_date"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
string
"state"
t
.
integer
"iid"
end
...
...
@@ -163,8 +163,8 @@ ActiveRecord::Schema.define(version: 20140312145357) do
t
.
string
"name"
,
null:
false
t
.
string
"path"
,
null:
false
t
.
integer
"owner_id"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
string
"type"
t
.
string
"description"
,
default:
""
,
null:
false
t
.
string
"avatar"
...
...
@@ -179,15 +179,15 @@ ActiveRecord::Schema.define(version: 20140312145357) do
t
.
text
"note"
t
.
string
"noteable_type"
t
.
integer
"author_id"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
integer
"project_id"
t
.
string
"attachment"
t
.
string
"line_code"
t
.
string
"commit_id"
t
.
integer
"noteable_id"
t
.
boolean
"system"
,
default:
false
,
null:
false
t
.
text
"st_diff"
t
.
boolean
"system"
,
default:
false
,
null:
false
end
add_index
"notes"
,
[
"author_id"
],
name:
"index_notes_on_author_id"
,
using: :btree
...
...
@@ -202,8 +202,8 @@ ActiveRecord::Schema.define(version: 20140312145357) do
t
.
string
"name"
t
.
string
"path"
t
.
text
"description"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
integer
"creator_id"
t
.
boolean
"issues_enabled"
,
default:
true
,
null:
false
t
.
boolean
"wall_enabled"
,
default:
true
,
null:
false
...
...
@@ -214,22 +214,21 @@ ActiveRecord::Schema.define(version: 20140312145357) do
t
.
string
"issues_tracker_id"
t
.
boolean
"snippets_enabled"
,
default:
true
,
null:
false
t
.
datetime
"last_activity_at"
t
.
boolean
"imported"
,
default:
false
,
null:
false
t
.
string
"import_url"
t
.
integer
"visibility_level"
,
default:
0
,
null:
false
t
.
boolean
"archived"
,
default:
false
,
null:
false
t
.
string
"import_status"
end
add_index
"projects"
,
[
"creator_id"
],
name:
"index_projects_on_
creato
r_id"
,
using: :btree
add_index
"projects"
,
[
"creator_id"
],
name:
"index_projects_on_
owne
r_id"
,
using: :btree
add_index
"projects"
,
[
"last_activity_at"
],
name:
"index_projects_on_last_activity_at"
,
using: :btree
add_index
"projects"
,
[
"namespace_id"
],
name:
"index_projects_on_namespace_id"
,
using: :btree
create_table
"protected_branches"
,
force:
true
do
|
t
|
t
.
integer
"project_id"
,
null:
false
t
.
string
"name"
,
null:
false
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
end
add_index
"protected_branches"
,
[
"project_id"
],
name:
"index_protected_branches_on_project_id"
,
using: :btree
...
...
@@ -239,8 +238,8 @@ ActiveRecord::Schema.define(version: 20140312145357) do
t
.
string
"title"
t
.
string
"token"
t
.
integer
"project_id"
,
null:
false
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
boolean
"active"
,
default:
false
,
null:
false
t
.
string
"project_url"
t
.
string
"subdomain"
...
...
@@ -256,8 +255,8 @@ ActiveRecord::Schema.define(version: 20140312145357) do
t
.
text
"content"
t
.
integer
"author_id"
,
null:
false
t
.
integer
"project_id"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
string
"file_name"
t
.
datetime
"expires_at"
t
.
boolean
"private"
,
default:
true
,
null:
false
...
...
@@ -297,8 +296,8 @@ ActiveRecord::Schema.define(version: 20140312145357) do
t
.
datetime
"last_sign_in_at"
t
.
string
"current_sign_in_ip"
t
.
string
"last_sign_in_ip"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
string
"name"
t
.
boolean
"admin"
,
default:
false
,
null:
false
t
.
integer
"projects_limit"
,
default:
10
...
...
@@ -320,7 +319,6 @@ ActiveRecord::Schema.define(version: 20140312145357) do
t
.
integer
"notification_level"
,
default:
1
,
null:
false
t
.
datetime
"password_expires_at"
t
.
integer
"created_by_id"
t
.
datetime
"last_credential_check_at"
t
.
string
"avatar"
t
.
string
"confirmation_token"
t
.
datetime
"confirmed_at"
...
...
@@ -328,6 +326,7 @@ ActiveRecord::Schema.define(version: 20140312145357) do
t
.
string
"unconfirmed_email"
t
.
boolean
"hide_no_ssh_key"
,
default:
false
t
.
string
"website_url"
,
default:
""
,
null:
false
t
.
datetime
"last_credential_check_at"
end
add_index
"users"
,
[
"admin"
],
name:
"index_users_on_admin"
,
using: :btree
...
...
@@ -343,8 +342,8 @@ ActiveRecord::Schema.define(version: 20140312145357) do
t
.
integer
"group_access"
,
null:
false
t
.
integer
"group_id"
,
null:
false
t
.
integer
"user_id"
,
null:
false
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
integer
"notification_level"
,
default:
3
,
null:
false
end
...
...
@@ -353,8 +352,8 @@ ActiveRecord::Schema.define(version: 20140312145357) do
create_table
"users_projects"
,
force:
true
do
|
t
|
t
.
integer
"user_id"
,
null:
false
t
.
integer
"project_id"
,
null:
false
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
integer
"project_access"
,
default:
0
,
null:
false
t
.
integer
"notification_level"
,
default:
3
,
null:
false
end
...
...
@@ -366,8 +365,8 @@ ActiveRecord::Schema.define(version: 20140312145357) do
create_table
"web_hooks"
,
force:
true
do
|
t
|
t
.
string
"url"
t
.
integer
"project_id"
t
.
datetime
"created_at"
t
.
datetime
"updated_at"
t
.
datetime
"created_at"
,
null:
false
t
.
datetime
"updated_at"
,
null:
false
t
.
string
"type"
,
default:
"ProjectHook"
t
.
integer
"service_id"
t
.
boolean
"push_events"
,
default:
true
,
null:
false
...
...
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