-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 3570 - Grant Activity digest notification preference (#3582)
- Loading branch information
Showing
4 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
.../migrations/20241004230649_add_grant_activity_to_email_subscriptions_notification_type.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
exports.up = function (knex) { | ||
return knex.schema.raw( | ||
` | ||
-- Drop the existing stale constraint | ||
ALTER TABLE email_subscriptions DROP CONSTRAINT email_subscriptions_notification_type_check; | ||
-- Add new updated constraint | ||
ALTER TABLE email_subscriptions ADD CONSTRAINT email_subscriptions_notification_type_check CHECK (notification_type IN ('GRANT_ASSIGNMENT', 'GRANT_INTEREST', 'GRANT_DIGEST', 'GRANT_FINDER_UPDATES', 'GRANT_ACTIVITY')); | ||
`, | ||
); | ||
}; | ||
|
||
/** | ||
* @param { import("knex").Knex } knex | ||
* @returns { Promise<void> } | ||
*/ | ||
exports.down = function (knex) { | ||
return knex.schema.raw( | ||
` | ||
-- Drop the existing stale constraint | ||
ALTER TABLE email_subscriptions DROP CONSTRAINT email_subscriptions_notification_type_check; | ||
-- Add new updated constraint | ||
ALTER TABLE email_subscriptions ADD CONSTRAINT email_subscriptions_notification_type_check CHECK (notification_type IN ('GRANT_ASSIGNMENT', 'GRANT_INTEREST', 'GRANT_DIGEST', 'GRANT_FINDER_UPDATES')); | ||
`, | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters