Skip to content

Commit

Permalink
increase size of url column for media. #225
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner committed Apr 9, 2019
1 parent 15dfa97 commit 79b9146
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
11 changes: 11 additions & 0 deletions db/migrate/20190409211358_change_media_url_column_type.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class ChangeMediaUrlColumnType < ActiveRecord::Migration[5.2]
def up
change_column :media, :url, :text, limit: 65535
add_index :media, :url, name: 'index_media_on_url', length: 100
end

def down
remove_index :media, name: "index_media_on_url", column: :url
change_column :media, :url, :string
end
end
5 changes: 3 additions & 2 deletions db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2019_03_02_161113) do
ActiveRecord::Schema.define(version: 2019_04_09_211358) do

create_table "active_storage_attachments", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin", force: :cascade do |t|
t.string "name", limit: 191, null: false
Expand Down Expand Up @@ -193,11 +193,12 @@
t.datetime "created"
t.string "media_type", limit: 80
t.datetime "updated"
t.string "url", null: false
t.text "url", null: false
t.integer "version"
t.bigint "dataset", null: false
t.index ["dataset", "updated"], name: "dataset_updated"
t.index ["dataset"], name: "FK62F6FE44D3D6B1B"
t.index ["url"], name: "index_media_on_url", length: 100
end

create_table "metadata", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
Expand Down

0 comments on commit 79b9146

Please sign in to comment.