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, + }) +}