mirror of
https://github.com/internetee/registry.git
synced 2025-05-16 01:17:18 +02:00
parent
3162c76bbf
commit
261c3cc157
2 changed files with 17 additions and 1 deletions
6
db/migrate/20170506212014_add_account_registrar_fk.rb
Normal file
6
db/migrate/20170506212014_add_account_registrar_fk.rb
Normal file
|
@ -0,0 +1,6 @@
|
|||
class AddAccountRegistrarFk < ActiveRecord::Migration
|
||||
def change
|
||||
change_column :accounts, :registrar_id, :integer, null: false
|
||||
add_foreign_key :accounts, :registrars
|
||||
end
|
||||
end
|
|
@ -327,7 +327,7 @@ ALTER SEQUENCE account_activities_id_seq OWNED BY account_activities.id;
|
|||
|
||||
CREATE TABLE accounts (
|
||||
id integer NOT NULL,
|
||||
registrar_id integer,
|
||||
registrar_id integer NOT NULL,
|
||||
account_type character varying,
|
||||
balance numeric(10,2) DEFAULT 0.0 NOT NULL,
|
||||
created_at timestamp without time zone,
|
||||
|
@ -4792,6 +4792,14 @@ ALTER TABLE ONLY account_activities
|
|||
ADD CONSTRAINT fk_rails_b80dbb973d FOREIGN KEY (bank_transaction_id) REFERENCES bank_transactions(id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: fk_rails_c9f635c0b3; Type: FK CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
||||
ALTER TABLE ONLY accounts
|
||||
ADD CONSTRAINT fk_rails_c9f635c0b3 FOREIGN KEY (registrar_id) REFERENCES registrars(id);
|
||||
|
||||
|
||||
--
|
||||
-- Name: fk_rails_ce38d749f6; Type: FK CONSTRAINT; Schema: public; Owner: -
|
||||
--
|
||||
|
@ -5298,3 +5306,5 @@ INSERT INTO schema_migrations (version) VALUES ('20170506205356');
|
|||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20170506205946');
|
||||
|
||||
INSERT INTO schema_migrations (version) VALUES ('20170506212014');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue