Convert author_ip to a proper INET field

This commit is contained in:
Tom Hughes 2012-12-03 13:00:52 +00:00
parent c533fb4b74
commit 31a031be26
2 changed files with 12 additions and 1 deletions

View file

@ -0,0 +1,9 @@
class ChangeNoteAddressToInet < ActiveRecord::Migration
def up
execute "ALTER TABLE note_comments ALTER COLUMN author_ip TYPE inet USING CAST(author_ip AS inet)"
end
def down
change_column :note_comments, :author_ip, :string
end
end

View file

@ -733,7 +733,7 @@ CREATE TABLE note_comments (
note_id bigint NOT NULL,
visible boolean NOT NULL,
created_at timestamp without time zone NOT NULL,
author_ip character varying(255),
author_ip inet,
author_id bigint,
body text,
event note_event_enum
@ -2449,6 +2449,8 @@ INSERT INTO schema_migrations (version) VALUES ('20121119165817');
INSERT INTO schema_migrations (version) VALUES ('20121202155309');
INSERT INTO schema_migrations (version) VALUES ('20121203124841');
INSERT INTO schema_migrations (version) VALUES ('21');
INSERT INTO schema_migrations (version) VALUES ('22');