]> git.openstreetmap.org Git - rails.git/commitdiff
Merge remote-tracking branch 'upstream/pull/5510'
authorTom Hughes <tom@compton.nu>
Sat, 18 Jan 2025 11:41:08 +0000 (11:41 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 18 Jan 2025 11:41:08 +0000 (11:41 +0000)
db/migrate/20250105154621_validate_foreign_key_on_notes.rb [new file with mode: 0644]
db/structure.sql

diff --git a/db/migrate/20250105154621_validate_foreign_key_on_notes.rb b/db/migrate/20250105154621_validate_foreign_key_on_notes.rb
new file mode 100644 (file)
index 0000000..8ff7df9
--- /dev/null
@@ -0,0 +1,5 @@
+class ValidateForeignKeyOnNotes < ActiveRecord::Migration[7.2]
+  def change
+    validate_foreign_key :notes, :users
+  end
+end
index fe0b4e481ae00779b100be603fb7c3f0aff59085..04b0dc17f13128dc12d1d7982a141243a1fe16e2 100644 (file)
@@ -3218,7 +3218,7 @@ ALTER TABLE ONLY public.note_comments
 --
 
 ALTER TABLE ONLY public.notes
-    ADD CONSTRAINT notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id) NOT VALID;
+    ADD CONSTRAINT notes_user_id_fkey FOREIGN KEY (user_id) REFERENCES public.users(id);
 
 
 --
@@ -3408,6 +3408,7 @@ INSERT INTO "schema_migrations" (version) VALUES
 ('23'),
 ('22'),
 ('21'),
+('20250105154621'),
 ('20250104140952'),
 ('20241023004427'),
 ('20241022141247'),