Change database column type

#694
This commit is contained in:
Artur Beljajev 2018-02-18 02:46:20 +02:00
parent 46bca46320
commit e84a1dc0de
2 changed files with 9 additions and 2 deletions

View file

@ -0,0 +1,5 @@
class ChangeMessagesAttachedObjIdTypeToInt < ActiveRecord::Migration
def change
change_column :messages, :attached_obj_id, 'integer USING attached_obj_id::integer'
end
end

View file

@ -2186,7 +2186,7 @@ CREATE TABLE messages (
registrar_id integer,
body character varying NOT NULL,
attached_obj_type character varying,
attached_obj_id character varying,
attached_obj_id integer,
queued boolean,
created_at timestamp without time zone,
updated_at timestamp without time zone,
@ -3635,7 +3635,7 @@ ALTER TABLE ONLY contacts
--
-- Name: unique_session_id; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
-- Name: unique_session_id; Type: CONSTRAINT; Schema: public; Owner: -; Tablespace:
--
ALTER TABLE ONLY epp_sessions
@ -5098,3 +5098,5 @@ INSERT INTO schema_migrations (version) VALUES ('20180214200224');
INSERT INTO schema_migrations (version) VALUES ('20180214213743');
INSERT INTO schema_migrations (version) VALUES ('20180218004148');