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
01f4224f
Commit
01f4224f
authored
Aug 02, 2019
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add created_at to event_log_states table
parent
f1331073
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
1 deletion
+27
-1
ee/db/geo/migrate/20190802200655_add_created_at_to_event_log_states.rb
...rate/20190802200655_add_created_at_to_event_log_states.rb
+25
-0
ee/db/geo/schema.rb
ee/db/geo/schema.rb
+2
-1
No files found.
ee/db/geo/migrate/20190802200655_add_created_at_to_event_log_states.rb
0 → 100644
View file @
01f4224f
# frozen_string_literal: true
class
AddCreatedAtToEventLogStates
<
ActiveRecord
::
Migration
[
5.2
]
DOWNTIME
=
false
def
up
add_column
(
:event_log_states
,
:created_at
,
:datetime
,
null:
true
)
# There should only be 1 record in the event_log_states table
execute
(
'UPDATE event_log_states SET created_at = (
SELECT COALESCE(
(SELECT project_registry.created_at
FROM project_registry
ORDER BY project_registry.id ASC
LIMIT 1), NOW()
)
)'
)
change_column_null
(
:event_log_states
,
:created_at
,
false
)
end
def
down
remove_column
(
:event_log_states
,
:created_at
)
end
end
ee/db/geo/schema.rb
View file @
01f4224f
...
...
@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
2019_0
6_12_211021
)
do
ActiveRecord
::
Schema
.
define
(
version:
2019_0
8_02_200655
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
@@ -29,6 +29,7 @@ ActiveRecord::Schema.define(version: 2019_06_12_211021) do
end
create_table
"event_log_states"
,
primary_key:
"event_id"
,
force: :cascade
do
|
t
|
t
.
datetime
"created_at"
,
null:
false
end
create_table
"file_registry"
,
id: :serial
,
force: :cascade
do
|
t
|
...
...
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