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
05f1dc5f
Commit
05f1dc5f
authored
May 07, 2018
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge new CE remote_mirror migrations into EE, and disable ones that are already in EE
parent
783cfb9e
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
116 additions
and
11 deletions
+116
-11
db/migrate/20180503131624_create_remote_mirrors.rb
db/migrate/20180503131624_create_remote_mirrors.rb
+33
-0
db/migrate/20180503141722_add_remote_mirror_available_overridden_to_projects.rb
...722_add_remote_mirror_available_overridden_to_projects.rb
+2
-2
db/migrate/20180503193542_add_indexes_to_remote_mirror.rb
db/migrate/20180503193542_add_indexes_to_remote_mirror.rb
+15
-0
db/migrate/20180503193953_add_mirror_available_to_application_settings.rb
...503193953_add_mirror_available_to_application_settings.rb
+15
-0
ee/db/migrate/20160321161032_create_remote_mirrors_ee.rb
ee/db/migrate/20160321161032_create_remote_mirrors_ee.rb
+9
-2
ee/db/migrate/20170208144550_add_index_to_mirrors_last_update_at_fields.rb
...70208144550_add_index_to_mirrors_last_update_at_fields.rb
+2
-2
ee/db/migrate/20170427180205_add_last_update_started_at_column_to_remote_mirrors.rb
...05_add_last_update_started_at_column_to_remote_mirrors.rb
+8
-1
ee/db/migrate/20171017125928_add_remote_mirror_available_to_application_settings.rb
...28_add_remote_mirror_available_to_application_settings.rb
+3
-0
ee/db/migrate/20171017130239_add_remote_mirror_available_overridden_to_projects_ee.rb
..._add_remote_mirror_available_overridden_to_projects_ee.rb
+18
-0
ee/db/migrate/20180109150457_add_remote_name_to_remote_mirrors.rb
...grate/20180109150457_add_remote_name_to_remote_mirrors.rb
+8
-1
ee/db/post_migrate/20170427111108_remove_sync_time_column_from_remote_mirrors.rb
...0427111108_remove_sync_time_column_from_remote_mirrors.rb
+3
-3
No files found.
db/migrate/20180503131624_create_remote_mirrors.rb
0 → 100644
View file @
05f1dc5f
class
CreateRemoteMirrors
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
return
if
table_exists?
(
:remote_mirrors
)
create_table
:remote_mirrors
do
|
t
|
t
.
references
:project
,
index:
true
,
foreign_key:
{
on_delete: :cascade
}
t
.
string
:url
t
.
boolean
:enabled
,
default:
true
t
.
string
:update_status
t
.
datetime
:last_update_at
t
.
datetime
:last_successful_update_at
t
.
datetime
:last_update_started_at
t
.
string
:last_error
t
.
boolean
:only_protected_branches
,
default:
false
,
null:
false
t
.
string
:remote_name
t
.
text
:encrypted_credentials
t
.
string
:encrypted_credentials_iv
t
.
string
:encrypted_credentials_salt
t
.
timestamps
null:
false
end
end
def
down
# ee/db/migrate/20160321161032_create_remote_mirrors_ee.rb will remove the table
end
end
ee/db/migrate/20171017130239
_add_remote_mirror_available_overridden_to_projects.rb
→
db/migrate/20180503141722
_add_remote_mirror_available_overridden_to_projects.rb
View file @
05f1dc5f
...
...
@@ -6,10 +6,10 @@ class AddRemoteMirrorAvailableOverriddenToProjects < ActiveRecord::Migration
disable_ddl_transaction!
def
up
add_column
(
:projects
,
:remote_mirror_available_overridden
,
:boolean
)
add_column
(
:projects
,
:remote_mirror_available_overridden
,
:boolean
)
unless
column_exists?
(
:projects
,
:remote_mirror_available_overridden
)
end
def
down
remove_column
(
:projects
,
:remote_mirror_available_overridden
)
# ee/db/migrate/20171017130239_add_remote_mirror_available_overridden_to_projects_ee.rb will remove the column.
end
end
db/migrate/20180503193542_add_indexes_to_remote_mirror.rb
0 → 100644
View file @
05f1dc5f
class
AddIndexesToRemoteMirror
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
add_concurrent_index
:remote_mirrors
,
:last_successful_update_at
unless
index_exists?
(
:remote_mirrors
,
:last_successful_update_at
)
end
def
down
# ee/db/migrate/20170208144550_add_index_to_mirrors_last_update_at_fields.rb will remove the index.
end
end
db/migrate/20180503193953_add_mirror_available_to_application_settings.rb
0 → 100644
View file @
05f1dc5f
class
AddMirrorAvailableToApplicationSettings
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
add_column_with_default
(
:application_settings
,
:mirror_available
,
:boolean
,
default:
true
,
allow_null:
false
)
unless
column_exists?
(
:application_settings
,
:mirror_available
)
end
def
down
# ee/db/migrate/20171017125928_add_remote_mirror_available_to_application_settings.rb will remove the column.
end
end
ee/db/migrate/20160321161032_create_remote_mirrors.rb
→
ee/db/migrate/20160321161032_create_remote_mirrors
_ee
.rb
View file @
05f1dc5f
# rubocop:disable Migration/Datetime
# rubocop:disable Migration/Timestamps
class
CreateRemoteMirrors
<
ActiveRecord
::
Migration
def
change
class
CreateRemoteMirrorsEE
<
ActiveRecord
::
Migration
def
up
# When moving from CE to EE, remote_mirrors may already exist
return
if
table_exists?
(
:remote_mirrors
)
create_table
:remote_mirrors
do
|
t
|
t
.
references
:project
,
index:
true
,
foreign_key:
true
t
.
string
:url
...
...
@@ -17,4 +20,8 @@ class CreateRemoteMirrors < ActiveRecord::Migration
t
.
timestamps
null:
false
end
end
def
down
drop_table
:remote_mirrors
if
table_exists?
(
:remote_mirrors
)
end
end
ee/db/migrate/20170208144550_add_index_to_mirrors_last_update_at_fields.rb
View file @
05f1dc5f
...
...
@@ -7,8 +7,8 @@ class AddIndexToMirrorsLastUpdateAtFields < ActiveRecord::Migration
disable_ddl_transaction!
def
up
add_concurrent_index
:projects
,
:mirror_last_successful_update_at
add_concurrent_index
:remote_mirrors
,
:last_successful_update_at
add_concurrent_index
:projects
,
:mirror_last_successful_update_at
unless
index_exists?
:projects
,
:mirror_last_successful_update_at
add_concurrent_index
:remote_mirrors
,
:last_successful_update_at
unless
index_exists?
:remote_mirrors
,
:last_successful_update_at
end
def
down
...
...
ee/db/migrate/20170427180205_add_last_update_started_at_column_to_remote_mirrors.rb
View file @
05f1dc5f
...
...
@@ -4,7 +4,14 @@ class AddLastUpdateStartedAtColumnToRemoteMirrors < ActiveRecord::Migration
DOWNTIME
=
false
def
change
def
up
# When moving from CE to EE, this column may already exist
return
if
column_exists?
(
:remote_mirrors
,
:last_update_started_at
)
add_column
:remote_mirrors
,
:last_update_started_at
,
:datetime
end
def
down
remove_column
:remote_mirrors
,
:last_update_started_at
end
end
ee/db/migrate/20171017125928_add_remote_mirror_available_to_application_settings.rb
View file @
05f1dc5f
...
...
@@ -6,6 +6,9 @@ class AddRemoteMirrorAvailableToApplicationSettings < ActiveRecord::Migration
disable_ddl_transaction!
def
up
# When moving from CE to EE, this column may already exist
return
if
column_exists?
(
:application_settings
,
:remote_mirror_available
)
add_column_with_default
(
:application_settings
,
:remote_mirror_available
,
:boolean
,
default:
true
,
allow_null:
false
)
end
...
...
ee/db/migrate/20171017130239_add_remote_mirror_available_overridden_to_projects_ee.rb
0 → 100644
View file @
05f1dc5f
class
AddRemoteMirrorAvailableOverriddenToProjectsEE
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
# When moving from CE to EE, this column may already exist
return
if
column_exists?
(
:projects
,
:remote_mirror_available_overridden
)
add_column
(
:projects
,
:remote_mirror_available_overridden
,
:boolean
)
end
def
down
remove_column
(
:projects
,
:remote_mirror_available_overridden
)
end
end
ee/db/migrate/20180109150457_add_remote_name_to_remote_mirrors.rb
View file @
05f1dc5f
...
...
@@ -3,7 +3,14 @@ class AddRemoteNameToRemoteMirrors < ActiveRecord::Migration
DOWNTIME
=
false
def
change
def
up
# When moving from CE to EE, this column may already exist
return
if
column_exists?
(
:remote_mirrors
,
:remote_name
)
add_column
:remote_mirrors
,
:remote_name
,
:string
end
def
down
remove_column
:remote_mirrors
,
:remote_name
end
end
ee/db/post_migrate/20170427111108_remove_sync_time_column_from_remote_mirrors.rb
View file @
05f1dc5f
...
...
@@ -7,11 +7,11 @@ class RemoveSyncTimeColumnFromRemoteMirrors < ActiveRecord::Migration
def
up
remove_concurrent_index
:remote_mirrors
,
[
:sync_time
]
if
index_exists?
:remote_mirrors
,
[
:sync_time
]
remove_column
:remote_mirrors
,
:sync_time
,
:integer
remove_column
:remote_mirrors
,
:sync_time
,
:integer
if
column_exists?
:remote_mirrors
,
:sync_time
end
def
down
add_column
:remote_mirrors
,
:sync_time
,
:integer
add_concurrent_index
:remote_mirrors
,
[
:sync_time
]
add_column
:remote_mirrors
,
:sync_time
,
:integer
unless
column_exists?
:remote_mirrors
,
:sync_time
add_concurrent_index
:remote_mirrors
,
[
:sync_time
]
unless
index_exists?
:remote_mirrors
,
[
:sync_time
]
end
end
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