-
Notifications
You must be signed in to change notification settings - Fork 438
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2522 from Ana06/name-string
[api] Change Project & Package name type to String
- Loading branch information
Showing
2 changed files
with
15 additions
and
5 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
src/api/db/migrate/20170103132257_change_project_package_name_to_string.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class ChangeProjectPackageNameToString < ActiveRecord::Migration[5.0] | ||
def change | ||
execute 'UPDATE projects SET name = SUBSTR(name, 1, 200)' | ||
execute 'UPDATE projects SET name = "" WHERE name is null' | ||
execute 'UPDATE packages SET name = SUBSTR(name, 1, 200)' | ||
execute 'UPDATE packages SET name = "" WHERE name is null' | ||
change_column :projects, :name, :string, limit: 200, null: false | ||
change_column :packages, :name, :string, limit: 200, null: false | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters