From 16b14b1650b55cccabbdc0d3a1accaa8f536d87f Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Mon, 22 Feb 2021 11:25:13 +0100 Subject: [PATCH] Extend uploaderip field to cope with IPv6 addresses --- db/migrate/20210222102040_extend_ip_field.rb | 5 +++++ db/schema.rb | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 db/migrate/20210222102040_extend_ip_field.rb diff --git a/db/migrate/20210222102040_extend_ip_field.rb b/db/migrate/20210222102040_extend_ip_field.rb new file mode 100644 index 0000000..3a22e8a --- /dev/null +++ b/db/migrate/20210222102040_extend_ip_field.rb @@ -0,0 +1,5 @@ +class ExtendIpField < ActiveRecord::Migration[6.1] + def change + change_column :screenshots, :uploaderip, :string, limit: 40 + end +end diff --git a/db/schema.rb b/db/schema.rb index 6416617..9fa66df 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -2,15 +2,15 @@ # of editing this file, please use the migrations feature of Active Record to # incrementally modify your database, and then regenerate this schema definition. # -# This file is the source Rails uses to define your schema when running `rails -# db:schema:load`. When creating a new database, `rails db:schema:load` tends to +# This file is the source Rails uses to define your schema when running `bin/rails +# db:schema:load`. When creating a new database, `bin/rails db:schema:load` tends to # be faster and is potentially less error prone than running all of your # migrations from scratch. Old migrations may fail to apply correctly if those # migrations use external dependencies or application code. # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2020_10_31_112024) do +ActiveRecord::Schema.define(version: 2021_02_22_102040) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -87,7 +87,7 @@ ActiveRecord::Schema.define(version: 2020_10_31_112024) do t.string "version", limit: 50 t.datetime "created_at" t.string "uploaderhash", limit: 72 - t.string "uploaderip", limit: 15 + t.string "uploaderip", limit: 40 t.boolean "approved", default: false, null: false t.boolean "markedfordelete" t.string "delete_reason", limit: 100