Recreate ipaddress field as PostgreSQL's inet type

This commit is contained in:
Christoph Haas 2021-02-22 11:31:34 +01:00
parent 16b14b1650
commit 3f2928e737
2 changed files with 8 additions and 2 deletions

View file

@ -0,0 +1,6 @@
class ChangeIpFieldToInet < ActiveRecord::Migration[6.1]
def change
remove_column :screenshots, :uploaderip
add_column :screenshots, :uploaderip, :inet
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2021_02_22_102040) do
ActiveRecord::Schema.define(version: 2021_02_22_102719) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -87,7 +87,6 @@ ActiveRecord::Schema.define(version: 2021_02_22_102040) do
t.string "version", limit: 50
t.datetime "created_at"
t.string "uploaderhash", limit: 72
t.string "uploaderip", limit: 40
t.boolean "approved", default: false, null: false
t.boolean "markedfordelete"
t.string "delete_reason", limit: 100
@ -100,6 +99,7 @@ ActiveRecord::Schema.define(version: 2021_02_22_102040) do
t.string "image_fingerprint"
t.integer "user_id", default: 0
t.text "simage_data"
t.inet "uploaderip"
t.index ["id", "approved"], name: "id_approved"
t.index ["id", "uploaderhash"], name: "id_uploaderhash"
end