aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar √Čtienne Deparis 2022-07-12 19:20:40 +0200
committerGravatar √Čtienne Deparis 2022-07-12 19:25:42 +0200
commit58adccde492ee6ebd9ec9ee43e7d1cd48e734d86 (patch)
tree0dc561501ba53f26120537caffed6404321eb793
parent7f6f4517084478b118154f6130f8259aad555e31 (diff)
downloadbiberons-58adccde492ee6ebd9ec9ee43e7d1cd48e734d86.tar.gz
biberons-58adccde492ee6ebd9ec9ee43e7d1cd48e734d86.tar.xz
biberons-58adccde492ee6ebd9ec9ee43e7d1cd48e734d86.zip
refactor: Use a real foreign key definition for baby_id
-rw-r--r--db/migrations/202207121903_add_fkey_for_babies.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/db/migrations/202207121903_add_fkey_for_babies.rb b/db/migrations/202207121903_add_fkey_for_babies.rb
new file mode 100644
index 0000000..2289f84
--- /dev/null
+++ b/db/migrations/202207121903_add_fkey_for_babies.rb
@@ -0,0 +1,10 @@
+# frozen_string_literal: true
+
+Sequel.migration do
+ change do
+ alter_table :biberons do
+ add_foreign_key [:baby_id], :babies,
+ on_delete: :cascade, name: :biberons_baby_id_fkey
+ end
+ end
+end