Add foreign key

#697
This commit is contained in:
Artur Beljajev 2018-02-11 03:21:11 +02:00
parent a65354c301
commit 169ce19e96
2 changed files with 15 additions and 0 deletions

View file

@ -0,0 +1,5 @@
class AddMessagesRegistrarIdFk < ActiveRecord::Migration
def change
add_foreign_key :messages, :registrars, name: 'messages_registrar_id_fk'
end
end

View file

@ -4516,6 +4516,14 @@ ALTER TABLE ONLY account_activities
ADD CONSTRAINT fk_rails_d2cc3c2fa9 FOREIGN KEY (price_id) REFERENCES prices(id); ADD CONSTRAINT fk_rails_d2cc3c2fa9 FOREIGN KEY (price_id) REFERENCES prices(id);
--
-- Name: messages_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: -
--
ALTER TABLE ONLY messages
ADD CONSTRAINT messages_registrar_id_fk FOREIGN KEY (registrar_id) REFERENCES registrars(id);
-- --
-- Name: user_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: - -- Name: user_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: -
-- --
@ -5072,3 +5080,5 @@ INSERT INTO schema_migrations (version) VALUES ('20180126104903');
INSERT INTO schema_migrations (version) VALUES ('20180211011450'); INSERT INTO schema_migrations (version) VALUES ('20180211011450');
INSERT INTO schema_migrations (version) VALUES ('20180211011948');