From 4706352416005962ccb34bad1c3acc5d7479523c Mon Sep 17 00:00:00 2001 From: Mayra Cabrera Date: Fri, 23 Aug 2019 21:36:12 +0000 Subject: Adds cop to enforce string limits on migrations This cop will analyze migrations that add columns with string, and report an offense if the string has no limit enforced Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/64505 --- db/migrate/20181122160027_create_project_repositories.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'db/migrate/20181122160027_create_project_repositories.rb') diff --git a/db/migrate/20181122160027_create_project_repositories.rb b/db/migrate/20181122160027_create_project_repositories.rb index e42cef9b1c6..3f123daa150 100644 --- a/db/migrate/20181122160027_create_project_repositories.rb +++ b/db/migrate/20181122160027_create_project_repositories.rb @@ -11,7 +11,7 @@ class CreateProjectRepositories < ActiveRecord::Migration[5.0] def change create_table :project_repositories, id: :bigserial do |t| t.references :shard, null: false, index: true, foreign_key: { on_delete: :restrict } - t.string :disk_path, null: false, index: { unique: true } + t.string :disk_path, null: false, index: { unique: true } # rubocop:disable Migration/AddLimitToStringColumns t.references :project, null: false, index: { unique: true }, foreign_key: { on_delete: :cascade } end end -- cgit v1.2.1