Commit 3c49ede1 authored by Jarka Košanová's avatar Jarka Košanová Committed by Adam Hegyi

Create open_project_tracker_data table migration

- the data table will be used for storing data specific
for the service
parent af0f8dfa
---
title: Add migration for creating open_project_tracker_data table
merge_request: 26966
author:
type: other
# frozen_string_literal: true
# See https://docs.gitlab.com/ee/development/migration_style_guide.html
# for more information on how to write migrations for GitLab.
class AddOpenProjectTrackerData < ActiveRecord::Migration[6.0]
DOWNTIME = false
def change
create_table :open_project_tracker_data do |t|
t.references :service, foreign_key: { on_delete: :cascade }, type: :integer, index: true, null: false
t.timestamps_with_timezone
t.string :encrypted_url, limit: 255
t.string :encrypted_url_iv, limit: 255
t.string :encrypted_api_url, limit: 255
t.string :encrypted_api_url_iv, limit: 255
t.string :encrypted_token, limit: 255
t.string :encrypted_token_iv, limit: 255
t.string :closed_status_id, limit: 5
t.string :project_identifier_code, limit: 100
end
end
end
......@@ -2921,6 +2921,21 @@ ActiveRecord::Schema.define(version: 2020_03_11_165635) do
t.index ["access_grant_id"], name: "index_oauth_openid_requests_on_access_grant_id"
end
create_table "open_project_tracker_data", force: :cascade do |t|
t.integer "service_id", null: false
t.datetime_with_timezone "created_at", null: false
t.datetime_with_timezone "updated_at", null: false
t.string "encrypted_url", limit: 255
t.string "encrypted_url_iv", limit: 255
t.string "encrypted_api_url", limit: 255
t.string "encrypted_api_url_iv", limit: 255
t.string "encrypted_token", limit: 255
t.string "encrypted_token_iv", limit: 255
t.string "closed_status_id", limit: 5
t.string "project_identifier_code", limit: 100
t.index ["service_id"], name: "index_open_project_tracker_data_on_service_id"
end
create_table "operations_feature_flag_scopes", force: :cascade do |t|
t.bigint "feature_flag_id", null: false
t.datetime_with_timezone "created_at", null: false
......@@ -4993,6 +5008,7 @@ ActiveRecord::Schema.define(version: 2020_03_11_165635) do
add_foreign_key "notes", "reviews", name: "fk_2e82291620", on_delete: :nullify
add_foreign_key "notification_settings", "users", name: "fk_0c95e91db7", on_delete: :cascade
add_foreign_key "oauth_openid_requests", "oauth_access_grants", column: "access_grant_id", name: "fk_77114b3b09", on_delete: :cascade
add_foreign_key "open_project_tracker_data", "services", on_delete: :cascade
add_foreign_key "operations_feature_flag_scopes", "operations_feature_flags", column: "feature_flag_id", on_delete: :cascade
add_foreign_key "operations_feature_flags", "projects", on_delete: :cascade
add_foreign_key "operations_feature_flags_clients", "projects", on_delete: :cascade
......
......@@ -60,6 +60,7 @@ describe 'Database schema' do
oauth_access_grants: %w[resource_owner_id application_id],
oauth_access_tokens: %w[resource_owner_id application_id],
oauth_applications: %w[owner_id],
open_project_tracker_data: %w[closed_status_id],
project_group_links: %w[group_id],
project_statistics: %w[namespace_id],
projects: %w[creator_id namespace_id ci_id mirror_user_id],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment