diff --git a/db/migrate/20190811202347_add_invoices_buyer_id_fk.rb b/db/migrate/20190811202347_add_invoices_buyer_id_fk.rb new file mode 100644 index 000000000..de2a82fcd --- /dev/null +++ b/db/migrate/20190811202347_add_invoices_buyer_id_fk.rb @@ -0,0 +1,5 @@ +class AddInvoicesBuyerIdFk < ActiveRecord::Migration + def change + add_foreign_key :invoices, :registrars, column: :buyer_id + end +end diff --git a/db/structure.sql b/db/structure.sql index 09925eac5..0e122c441 100644 --- a/db/structure.sql +++ b/db/structure.sql @@ -3913,6 +3913,14 @@ ALTER TABLE ONLY public.domains ADD CONSTRAINT domains_registrar_id_fk FOREIGN KEY (registrar_id) REFERENCES public.registrars(id); +-- +-- Name: fk_rails_242b91538b; Type: FK CONSTRAINT; Schema: public; Owner: - +-- + +ALTER TABLE ONLY public.invoices + ADD CONSTRAINT fk_rails_242b91538b FOREIGN KEY (buyer_id) REFERENCES public.registrars(id); + + -- -- Name: fk_rails_59c422f73d; Type: FK CONSTRAINT; Schema: public; Owner: - -- @@ -4823,3 +4831,5 @@ INSERT INTO schema_migrations (version) VALUES ('20190811195814'); INSERT INTO schema_migrations (version) VALUES ('20190811202042'); +INSERT INTO schema_migrations (version) VALUES ('20190811202347'); +