From 11df077ff902fba549e89285ffc094dd82335668 Mon Sep 17 00:00:00 2001 From: Joe Saunderson Date: Tue, 5 Apr 2022 22:12:51 +0100 Subject: [PATCH] All null profile ids for messages and replies --- .../1649193014422_allow-null-profile-ids.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 migrations/1649193014422_allow-null-profile-ids.js diff --git a/migrations/1649193014422_allow-null-profile-ids.js b/migrations/1649193014422_allow-null-profile-ids.js new file mode 100644 index 00000000..96477e9d --- /dev/null +++ b/migrations/1649193014422_allow-null-profile-ids.js @@ -0,0 +1,19 @@ +/* eslint-disable camelcase */ + +exports.shorthands = undefined + +exports.up = (pgm) => { + pgm.alterColumn({ schema: 'public', name: 'squeak_messages' }, 'profile_id', { + type: 'bigint', + references: { schema: 'public', name: 'squeak_profiles' }, + referencesConstraintName: 'messages_profile_id_fkey', + allowNull: true, + }) + + pgm.alterColumn({ schema: 'public', name: 'squeak_replies' }, 'profile_id', { + type: 'bigint', + references: { schema: 'public', name: 'squeak_profiles' }, + referencesConstraintName: 'replies_profile_id_fkey', + allowNull: true, + }) +}