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
0316d92f
Commit
0316d92f
authored
Nov 11, 2020
by
Vitali Tatarintev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create table to store on-call schedules
parent
85332ae2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
72 additions
and
0 deletions
+72
-0
db/migrate/20201111115414_create_incident_management_oncall_schedules.rb
...1111115414_create_incident_management_oncall_schedules.rb
+36
-0
db/schema_migrations/20201111115414
db/schema_migrations/20201111115414
+1
-0
db/structure.sql
db/structure.sql
+35
-0
No files found.
db/migrate/20201111115414_create_incident_management_oncall_schedules.rb
0 → 100644
View file @
0316d92f
# frozen_string_literal: true
class
CreateIncidentManagementOncallSchedules
<
ActiveRecord
::
Migration
[
6.0
]
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
with_lock_retries
do
unless
table_exists?
(
:incident_management_oncall_schedules
)
create_table
:incident_management_oncall_schedules
do
|
t
|
t
.
timestamps_with_timezone
t
.
references
:project
,
index:
true
,
null:
false
,
foreign_key:
{
on_delete: :cascade
}
t
.
integer
:iid
,
null:
false
t
.
text
:name
,
null:
false
t
.
text
:description
t
.
text
:timezone
t
.
index
%w(project_id iid)
,
name:
'index_im_oncall_schedules_on_project_id_and_iid'
,
unique:
true
,
using: :btree
end
end
end
add_text_limit
:incident_management_oncall_schedules
,
:name
,
200
add_text_limit
:incident_management_oncall_schedules
,
:description
,
1000
add_text_limit
:incident_management_oncall_schedules
,
:timezone
,
100
end
def
down
with_lock_retries
do
drop_table
:incident_management_oncall_schedules
end
end
end
db/schema_migrations/20201111115414
0 → 100644
View file @
0316d92f
0efb2dcfc65da007a67a15857d0a283dad301650f999a4227aa54ea00dca24bf
\ No newline at end of file
db/structure.sql
View file @
0316d92f
...
@@ -12858,6 +12858,29 @@ CREATE SEQUENCE import_failures_id_seq
...
@@ -12858,6 +12858,29 @@ CREATE SEQUENCE import_failures_id_seq
ALTER
SEQUENCE
import_failures_id_seq
OWNED
BY
import_failures
.
id
;
ALTER
SEQUENCE
import_failures_id_seq
OWNED
BY
import_failures
.
id
;
CREATE
TABLE
incident_management_oncall_schedules
(
id
bigint
NOT
NULL
,
created_at
timestamp
with
time
zone
NOT
NULL
,
updated_at
timestamp
with
time
zone
NOT
NULL
,
project_id
bigint
NOT
NULL
,
iid
integer
NOT
NULL
,
name
text
NOT
NULL
,
description
text
,
timezone
text
,
CONSTRAINT
check_7ed1fd5aa7
CHECK
((
char_length
(
description
)
<=
1000
)),
CONSTRAINT
check_cc77cbb103
CHECK
((
char_length
(
timezone
)
<=
100
)),
CONSTRAINT
check_e6ef43a664
CHECK
((
char_length
(
name
)
<=
200
))
);
CREATE
SEQUENCE
incident_management_oncall_schedules_id_seq
START
WITH
1
INCREMENT
BY
1
NO
MINVALUE
NO
MAXVALUE
CACHE
1
;
ALTER
SEQUENCE
incident_management_oncall_schedules_id_seq
OWNED
BY
incident_management_oncall_schedules
.
id
;
CREATE
TABLE
index_statuses
(
CREATE
TABLE
index_statuses
(
id
integer
NOT
NULL
,
id
integer
NOT
NULL
,
project_id
integer
NOT
NULL
,
project_id
integer
NOT
NULL
,
...
@@ -18011,6 +18034,8 @@ ALTER TABLE ONLY import_export_uploads ALTER COLUMN id SET DEFAULT nextval('impo
...
@@ -18011,6 +18034,8 @@ ALTER TABLE ONLY import_export_uploads ALTER COLUMN id SET DEFAULT nextval('impo
ALTER
TABLE
ONLY
import_failures
ALTER
COLUMN
id
SET
DEFAULT
nextval
(
'import_failures_id_seq'
::
regclass
);
ALTER
TABLE
ONLY
import_failures
ALTER
COLUMN
id
SET
DEFAULT
nextval
(
'import_failures_id_seq'
::
regclass
);
ALTER
TABLE
ONLY
incident_management_oncall_schedules
ALTER
COLUMN
id
SET
DEFAULT
nextval
(
'incident_management_oncall_schedules_id_seq'
::
regclass
);
ALTER
TABLE
ONLY
index_statuses
ALTER
COLUMN
id
SET
DEFAULT
nextval
(
'index_statuses_id_seq'
::
regclass
);
ALTER
TABLE
ONLY
index_statuses
ALTER
COLUMN
id
SET
DEFAULT
nextval
(
'index_statuses_id_seq'
::
regclass
);
ALTER
TABLE
ONLY
insights
ALTER
COLUMN
id
SET
DEFAULT
nextval
(
'insights_id_seq'
::
regclass
);
ALTER
TABLE
ONLY
insights
ALTER
COLUMN
id
SET
DEFAULT
nextval
(
'insights_id_seq'
::
regclass
);
...
@@ -19193,6 +19218,9 @@ ALTER TABLE ONLY import_export_uploads
...
@@ -19193,6 +19218,9 @@ ALTER TABLE ONLY import_export_uploads
ALTER
TABLE
ONLY
import_failures
ALTER
TABLE
ONLY
import_failures
ADD
CONSTRAINT
import_failures_pkey
PRIMARY
KEY
(
id
);
ADD
CONSTRAINT
import_failures_pkey
PRIMARY
KEY
(
id
);
ALTER
TABLE
ONLY
incident_management_oncall_schedules
ADD
CONSTRAINT
incident_management_oncall_schedules_pkey
PRIMARY
KEY
(
id
);
ALTER
TABLE
ONLY
index_statuses
ALTER
TABLE
ONLY
index_statuses
ADD
CONSTRAINT
index_statuses_pkey
PRIMARY
KEY
(
id
);
ADD
CONSTRAINT
index_statuses_pkey
PRIMARY
KEY
(
id
);
...
@@ -21070,6 +21098,8 @@ CREATE INDEX index_identities_on_saml_provider_id ON identities USING btree (sam
...
@@ -21070,6 +21098,8 @@ CREATE INDEX index_identities_on_saml_provider_id ON identities USING btree (sam
CREATE
INDEX
index_identities_on_user_id
ON
identities
USING
btree
(
user_id
);
CREATE
INDEX
index_identities_on_user_id
ON
identities
USING
btree
(
user_id
);
CREATE
UNIQUE
INDEX
index_im_oncall_schedules_on_project_id_and_iid
ON
incident_management_oncall_schedules
USING
btree
(
project_id
,
iid
);
CREATE
UNIQUE
INDEX
index_import_export_uploads_on_group_id
ON
import_export_uploads
USING
btree
(
group_id
)
WHERE
(
group_id
IS
NOT
NULL
);
CREATE
UNIQUE
INDEX
index_import_export_uploads_on_group_id
ON
import_export_uploads
USING
btree
(
group_id
)
WHERE
(
group_id
IS
NOT
NULL
);
CREATE
INDEX
index_import_export_uploads_on_project_id
ON
import_export_uploads
USING
btree
(
project_id
);
CREATE
INDEX
index_import_export_uploads_on_project_id
ON
import_export_uploads
USING
btree
(
project_id
);
...
@@ -21086,6 +21116,8 @@ CREATE INDEX index_import_failures_on_project_id_not_null ON import_failures USI
...
@@ -21086,6 +21116,8 @@ CREATE INDEX index_import_failures_on_project_id_not_null ON import_failures USI
CREATE
INDEX
index_imported_projects_on_import_type_creator_id_created_at
ON
projects
USING
btree
(
import_type
,
creator_id
,
created_at
)
WHERE
(
import_type
IS
NOT
NULL
);
CREATE
INDEX
index_imported_projects_on_import_type_creator_id_created_at
ON
projects
USING
btree
(
import_type
,
creator_id
,
created_at
)
WHERE
(
import_type
IS
NOT
NULL
);
CREATE
INDEX
index_incident_management_oncall_schedules_on_project_id
ON
incident_management_oncall_schedules
USING
btree
(
project_id
);
CREATE
UNIQUE
INDEX
index_index_statuses_on_project_id
ON
index_statuses
USING
btree
(
project_id
);
CREATE
UNIQUE
INDEX
index_index_statuses_on_project_id
ON
index_statuses
USING
btree
(
project_id
);
CREATE
INDEX
index_insights_on_namespace_id
ON
insights
USING
btree
(
namespace_id
);
CREATE
INDEX
index_insights_on_namespace_id
ON
insights
USING
btree
(
namespace_id
);
...
@@ -23556,6 +23588,9 @@ ALTER TABLE ONLY open_project_tracker_data
...
@@ -23556,6 +23588,9 @@ ALTER TABLE ONLY open_project_tracker_data
ALTER
TABLE
ONLY
gpg_signatures
ALTER
TABLE
ONLY
gpg_signatures
ADD
CONSTRAINT
fk_rails_19d4f1c6f9
FOREIGN
KEY
(
gpg_key_subkey_id
)
REFERENCES
gpg_key_subkeys
(
id
)
ON
DELETE
SET
NULL
;
ADD
CONSTRAINT
fk_rails_19d4f1c6f9
FOREIGN
KEY
(
gpg_key_subkey_id
)
REFERENCES
gpg_key_subkeys
(
id
)
ON
DELETE
SET
NULL
;
ALTER
TABLE
ONLY
incident_management_oncall_schedules
ADD
CONSTRAINT
fk_rails_19e83fdd65
FOREIGN
KEY
(
project_id
)
REFERENCES
projects
(
id
)
ON
DELETE
CASCADE
;
ALTER
TABLE
ONLY
vulnerability_user_mentions
ALTER
TABLE
ONLY
vulnerability_user_mentions
ADD
CONSTRAINT
fk_rails_1a41c485cd
FOREIGN
KEY
(
vulnerability_id
)
REFERENCES
vulnerabilities
(
id
)
ON
DELETE
CASCADE
;
ADD
CONSTRAINT
fk_rails_1a41c485cd
FOREIGN
KEY
(
vulnerability_id
)
REFERENCES
vulnerabilities
(
id
)
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