mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 09:27:19 +02:00
parent
8fa462dd43
commit
b20e31f3c8
2 changed files with 24 additions and 0 deletions
|
@ -0,0 +1,6 @@
|
||||||
|
class AddForeignKeyConstraintsToDomains < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_foreign_key :domains, :registrars, name: 'domains_registrar_id_fk'
|
||||||
|
add_foreign_key :domains, :contacts, column: :registrant_id, name: 'domains_registrant_id_fk'
|
||||||
|
end
|
||||||
|
end
|
|
@ -4646,6 +4646,22 @@ CREATE UNIQUE INDEX unique_data_migrations ON data_migrations USING btree (versi
|
||||||
CREATE UNIQUE INDEX unique_schema_migrations ON schema_migrations USING btree (version);
|
CREATE UNIQUE INDEX unique_schema_migrations ON schema_migrations USING btree (version);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: domains_registrant_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: -
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY domains
|
||||||
|
ADD CONSTRAINT domains_registrant_id_fk FOREIGN KEY (registrant_id) REFERENCES contacts(id);
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Name: domains_registrar_id_fk; Type: FK CONSTRAINT; Schema: public; Owner: -
|
||||||
|
--
|
||||||
|
|
||||||
|
ALTER TABLE ONLY domains
|
||||||
|
ADD CONSTRAINT domains_registrar_id_fk FOREIGN KEY (registrar_id) REFERENCES registrars(id);
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Name: fk_rails_78c376257f; Type: FK CONSTRAINT; Schema: public; Owner: -
|
-- Name: fk_rails_78c376257f; Type: FK CONSTRAINT; Schema: public; Owner: -
|
||||||
--
|
--
|
||||||
|
@ -5136,3 +5152,5 @@ INSERT INTO schema_migrations (version) VALUES ('20170424115801');
|
||||||
|
|
||||||
INSERT INTO schema_migrations (version) VALUES ('20170509215614');
|
INSERT INTO schema_migrations (version) VALUES ('20170509215614');
|
||||||
|
|
||||||
|
INSERT INTO schema_migrations (version) VALUES ('20170606133501');
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue