discourse/db/migrate/20200708051009_cap_bookmark...

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

15 lines
362 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class CapBookmarkNameAt100Characters < ActiveRecord::Migration[6.0]
def up
DB.exec(
"UPDATE bookmarks SET name = LEFT(name, 100) WHERE name IS NOT NULL AND name <> LEFT(name, 100)",
)
change_column :bookmarks, :name, :string, limit: 100
end
def down
raise ActiveRecord::IrreversibleMigration
end
end