Closed jeffreywescott closed 7 years ago
I'm planning to look at this this afternoon. Need to get some time this morning to stay heads-down and focus on RXP-related stories.
I see you renamed an old migration. The name of the migrations are stored in the database once they're applied.
This is probably not going to hurt anything since the timestamp should be used to determine if I migration has been run before, but it feels a little icky. I'm not sure the benefit of the renamed file outweighs the potential downsides of having the filename not match the entry in the _migrations
table.
Fixes ch89.
Overview
Up until now, we've been getting around the fact that our invite codes don't expire by periodically prefixing codes that we want to expire with the string
DISABLED--
. This manual process is a waste of time, and error-prone.This PR adds two flags to invite codes:
active
andpermanent
, defaulting totrue
andfalse
respectively. It also adds a script to expire old invite codes without theirpermanent
flag set totrue
if they haven't been used in at least two weeks.Data Model / DB Schema Changes
Adds
active
andpermanent
flags toinviteCodes
tables (via a migration) and GraphQL models.Environment / Configuration Changes
Adds an
npm
script:expireInviteCodes
that should be run once per day in production via Heroku's scheduler.Notes