Skip to content

Add project_key column to jira_tracker_data table

What does this MR do?

Add project_key column to jira_tracker_data table.

This is the foundation to expand the Jira integration. It's needed for any of the options discussed on &3622 (closed).

The default length of the project_key is 10 characters in Jira but it can be configured up to 255, look for Maximum project key size on: https://confluence.atlassian.com/adminjiraserver/configuring-jira-application-options-938847824.html

I'm following the documentation to add a text column to an existing table.

Migration script output

$ rails db:migrate
== 20200619154527 AddProjectKeyToJiraTrackerData: migrating ===================
-- add_column(:jira_tracker_data, :project_key, :text)
   -> 0.0009s
== 20200619154527 AddProjectKeyToJiraTrackerData: migrated (0.0010s) ==========

== 20200619154528 AddTextLimitToJiraTrackerDataProjectKey: migrating ==========
-- transaction_open?()
   -> 0.0000s
-- execute("ALTER TABLE jira_tracker_data\nADD CONSTRAINT check_214cf6a48b\nCHECK ( char_length(project_key) <= 255 )\nNOT VALID;\n")
   -> 0.0007s
-- execute("ALTER TABLE jira_tracker_data VALIDATE CONSTRAINT check_214cf6a48b;")
   -> 0.0005s
== 20200619154528 AddTextLimitToJiraTrackerDataProjectKey: migrated (0.0094s) =

Related to #223185 (closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports