diff --git a/db/migrate/20190409211358_change_media_url_column_type.rb b/db/migrate/20190409211358_change_media_url_column_type.rb new file mode 100644 index 000000000..23513c269 --- /dev/null +++ b/db/migrate/20190409211358_change_media_url_column_type.rb @@ -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 diff --git a/db/schema.rb b/db/schema.rb index c7165aacd..56711e7a6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -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 @@ -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|