Recreate ipaddress field as PostgreSQL's inet type
This commit is contained in:
parent
16b14b1650
commit
3f2928e737
2 changed files with 8 additions and 2 deletions
6
db/migrate/20210222102719_change_ip_field_to_inet.rb
Normal file
6
db/migrate/20210222102719_change_ip_field_to_inet.rb
Normal file
|
|
@ -0,0 +1,6 @@
|
||||||
|
class ChangeIpFieldToInet < ActiveRecord::Migration[6.1]
|
||||||
|
def change
|
||||||
|
remove_column :screenshots, :uploaderip
|
||||||
|
add_column :screenshots, :uploaderip, :inet
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
#
|
#
|
||||||
# It's strongly recommended that you check this file into your version control system.
|
# 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
|
# These are extensions that must be enabled in order to support this database
|
||||||
enable_extension "plpgsql"
|
enable_extension "plpgsql"
|
||||||
|
|
@ -87,7 +87,6 @@ ActiveRecord::Schema.define(version: 2021_02_22_102040) do
|
||||||
t.string "version", limit: 50
|
t.string "version", limit: 50
|
||||||
t.datetime "created_at"
|
t.datetime "created_at"
|
||||||
t.string "uploaderhash", limit: 72
|
t.string "uploaderhash", limit: 72
|
||||||
t.string "uploaderip", limit: 40
|
|
||||||
t.boolean "approved", default: false, null: false
|
t.boolean "approved", default: false, null: false
|
||||||
t.boolean "markedfordelete"
|
t.boolean "markedfordelete"
|
||||||
t.string "delete_reason", limit: 100
|
t.string "delete_reason", limit: 100
|
||||||
|
|
@ -100,6 +99,7 @@ ActiveRecord::Schema.define(version: 2021_02_22_102040) do
|
||||||
t.string "image_fingerprint"
|
t.string "image_fingerprint"
|
||||||
t.integer "user_id", default: 0
|
t.integer "user_id", default: 0
|
||||||
t.text "simage_data"
|
t.text "simage_data"
|
||||||
|
t.inet "uploaderip"
|
||||||
t.index ["id", "approved"], name: "id_approved"
|
t.index ["id", "approved"], name: "id_approved"
|
||||||
t.index ["id", "uploaderhash"], name: "id_uploaderhash"
|
t.index ["id", "uploaderhash"], name: "id_uploaderhash"
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue