Convert author_ip to a proper INET field
This commit is contained in:
parent
c533fb4b74
commit
31a031be26
2 changed files with 12 additions and 1 deletions
9
db/migrate/20121203124841_change_note_address_to_inet.rb
Normal file
9
db/migrate/20121203124841_change_note_address_to_inet.rb
Normal 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
|
|
@ -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');
|
||||
|
|
Loading…
Add table
Reference in a new issue