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
312bc703
Commit
312bc703
authored
Aug 01, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Geo::RepositoriesChangedEvent model
parent
35d73960
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
0 deletions
+41
-0
app/models/geo/repositories_changed_event.rb
app/models/geo/repositories_changed_event.rb
+9
-0
db/migrate/20170801200418_geo_repositories_changed_events.rb
db/migrate/20170801200418_geo_repositories_changed_events.rb
+13
-0
db/schema.rb
db/schema.rb
+8
-0
spec/models/geo/repositories_changed_event_spec.rb
spec/models/geo/repositories_changed_event_spec.rb
+11
-0
No files found.
app/models/geo/repositories_changed_event.rb
0 → 100644
View file @
312bc703
module
Geo
class
RepositoriesChangedEvent
<
ActiveRecord
::
Base
include
Geo
::
Model
belongs_to
:geo_node
validates
:geo_node
,
presence:
true
end
end
db/migrate/20170801200418_geo_repositories_changed_events.rb
0 → 100644
View file @
312bc703
class
GeoRepositoriesChangedEvents
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
def
change
create_table
:geo_repositories_changed_events
,
id: :bigserial
do
|
t
|
t
.
references
:geo_node
,
index:
true
,
foreign_key:
{
on_delete: :cascade
},
null:
false
end
add_column
:geo_event_log
,
:repositories_changed_event_id
,
:integer
,
limit:
8
end
end
db/schema.rb
View file @
312bc703
...
@@ -629,6 +629,7 @@ ActiveRecord::Schema.define(version: 20170803130232) do
...
@@ -629,6 +629,7 @@ ActiveRecord::Schema.define(version: 20170803130232) do
t
.
integer
"repository_updated_event_id"
,
limit:
8
t
.
integer
"repository_updated_event_id"
,
limit:
8
t
.
integer
"repository_deleted_event_id"
,
limit:
8
t
.
integer
"repository_deleted_event_id"
,
limit:
8
t
.
integer
"repository_renamed_event_id"
,
limit:
8
t
.
integer
"repository_renamed_event_id"
,
limit:
8
t
.
integer
"repositories_changed_event_id"
,
limit:
8
end
end
add_index
"geo_event_log"
,
[
"repository_updated_event_id"
],
name:
"index_geo_event_log_on_repository_updated_event_id"
,
using: :btree
add_index
"geo_event_log"
,
[
"repository_updated_event_id"
],
name:
"index_geo_event_log_on_repository_updated_event_id"
,
using: :btree
...
@@ -663,6 +664,12 @@ ActiveRecord::Schema.define(version: 20170803130232) do
...
@@ -663,6 +664,12 @@ ActiveRecord::Schema.define(version: 20170803130232) do
add_index
"geo_nodes"
,
[
"host"
],
name:
"index_geo_nodes_on_host"
,
using: :btree
add_index
"geo_nodes"
,
[
"host"
],
name:
"index_geo_nodes_on_host"
,
using: :btree
add_index
"geo_nodes"
,
[
"primary"
],
name:
"index_geo_nodes_on_primary"
,
using: :btree
add_index
"geo_nodes"
,
[
"primary"
],
name:
"index_geo_nodes_on_primary"
,
using: :btree
create_table
"geo_repositories_changed_events"
,
id: :bigserial
,
force: :cascade
do
|
t
|
t
.
integer
"geo_node_id"
,
null:
false
end
add_index
"geo_repositories_changed_events"
,
[
"geo_node_id"
],
name:
"index_geo_repositories_changed_events_on_geo_node_id"
,
using: :btree
create_table
"geo_repository_deleted_events"
,
id: :bigserial
,
force: :cascade
do
|
t
|
create_table
"geo_repository_deleted_events"
,
id: :bigserial
,
force: :cascade
do
|
t
|
t
.
integer
"project_id"
,
null:
false
t
.
integer
"project_id"
,
null:
false
t
.
text
"repository_storage_name"
,
null:
false
t
.
text
"repository_storage_name"
,
null:
false
...
@@ -1986,6 +1993,7 @@ ActiveRecord::Schema.define(version: 20170803130232) do
...
@@ -1986,6 +1993,7 @@ ActiveRecord::Schema.define(version: 20170803130232) do
add_foreign_key
"geo_event_log"
,
"geo_repository_updated_events"
,
column:
"repository_updated_event_id"
,
on_delete: :cascade
add_foreign_key
"geo_event_log"
,
"geo_repository_updated_events"
,
column:
"repository_updated_event_id"
,
on_delete: :cascade
add_foreign_key
"geo_node_namespace_links"
,
"geo_nodes"
,
on_delete: :cascade
add_foreign_key
"geo_node_namespace_links"
,
"geo_nodes"
,
on_delete: :cascade
add_foreign_key
"geo_node_namespace_links"
,
"namespaces"
,
name:
"fk_41ff5fb854"
,
on_delete: :cascade
add_foreign_key
"geo_node_namespace_links"
,
"namespaces"
,
name:
"fk_41ff5fb854"
,
on_delete: :cascade
add_foreign_key
"geo_repositories_changed_events"
,
"geo_nodes"
,
on_delete: :cascade
add_foreign_key
"geo_repository_renamed_events"
,
"projects"
,
on_delete: :cascade
add_foreign_key
"geo_repository_renamed_events"
,
"projects"
,
on_delete: :cascade
add_foreign_key
"geo_repository_updated_events"
,
"projects"
,
on_delete: :cascade
add_foreign_key
"geo_repository_updated_events"
,
"projects"
,
on_delete: :cascade
add_foreign_key
"index_statuses"
,
"projects"
,
name:
"fk_74b2492545"
,
on_delete: :cascade
add_foreign_key
"index_statuses"
,
"projects"
,
name:
"fk_74b2492545"
,
on_delete: :cascade
...
...
spec/models/geo/repositories_changed_event_spec.rb
0 → 100644
View file @
312bc703
require
'spec_helper'
describe
Geo
::
RepositoriesChangedEvent
,
type: :model
do
describe
'relationships'
do
it
{
is_expected
.
to
belong_to
(
:geo_node
)
}
end
describe
'validations'
do
it
{
is_expected
.
to
validate_presence_of
(
:geo_node
)
}
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