mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 21:27:23 +01:00
v3: define migration spec (add files)
This commit is contained in:
11
migrations/api_v3/challenges.js
Normal file
11
migrations/api_v3/challenges.js
Normal file
@@ -0,0 +1,11 @@
|
||||
/*
|
||||
name is required,
|
||||
shortName is required,
|
||||
tasksOrder
|
||||
habits, dailys, todos and rewards must be removed
|
||||
leader is required
|
||||
group is required
|
||||
members must be removed
|
||||
memberCount must be checked
|
||||
prize must be >= 0
|
||||
*/
|
||||
4
migrations/api_v3/emailUnsubscriptions.js
Normal file
4
migrations/api_v3/emailUnsubscriptions.js
Normal file
@@ -0,0 +1,4 @@
|
||||
/*
|
||||
email must be lowercase
|
||||
remove unique: true from mongoose schema
|
||||
*/
|
||||
17
migrations/api_v3/groups.js
Normal file
17
migrations/api_v3/groups.js
Normal file
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
name is required
|
||||
leader is required
|
||||
type is required
|
||||
privacy is required
|
||||
leaderOnly.challenges is required
|
||||
members are not stored anymore
|
||||
invites are not stored anymore
|
||||
challenges are not stored anymore
|
||||
balance > 0
|
||||
memberCount must be checked
|
||||
challengeCount must be checked
|
||||
quest.leader must be present (default to party leader)
|
||||
quest.key must be valid (otherwise remove)
|
||||
|
||||
tavern id and leader must be updated
|
||||
*/
|
||||
52
migrations/api_v3/indexes.js
Normal file
52
migrations/api_v3/indexes.js
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
DEFINE BEFORE MIGRATING
|
||||
|
||||
tasks: userId (sparse?), challenge.id (sparse), challenge.taskId (sparse), type? completed?
|
||||
users:
|
||||
id & apiToken?,
|
||||
auth.facebook.emails.value -> unique and sparse?,
|
||||
auth.facebook.id - unique and sparse,
|
||||
auth.local.email - unique and sparse,
|
||||
auth.local.lowerCaseUsername,
|
||||
auth.local.username - unique and sparse
|
||||
auth.local.username & auth.local.hashed_password?,
|
||||
auth.timestamps.created?,
|
||||
auth.timestamps.loggedin?,
|
||||
backer.tier -1
|
||||
{ "contributor.admin" : 1 , "contributor.level" : -1 , "backer.npc" : -1 , "profile.name" : 1}
|
||||
{ "contributor.admin" : 1.0}
|
||||
{ "contributor.level" : 1.0}
|
||||
{ "contributor.level" : 1.0 , "purchased.plan.customerId" : 1.0} ?
|
||||
{ "flags.lastWeeklyRecap" : 1 , "_id" : 1 , "preferences.emailNotifications.unsubscribeFromAll" : 1 , "preferences.emailNotifications.weeklyRecaps" : 1}
|
||||
{ "invitations.guilds.id" : 1}
|
||||
{ "invitations.party.id" : 1}
|
||||
{ "preferences.sleep" : 1 , "_id" : 1 , "flags.lastWeeklyRecap" : 1 , "preferences.emailNotifications.unsubscribeFromAll" : 1 , "preferences.emailNotifications.weeklyRecaps" : 1}
|
||||
{ "preferences.sleep" : 1 , "_id" : 1 , "lastCron" : 1 , "preferences.emailNotifications.importantAnnouncements" : 1 , "preferences.emailNotifications.unsubscribeFromAll" : 1 , "flags.recaptureEmailsPhase" : 1}
|
||||
profile.name ?
|
||||
{ "purchased.plan.customerId" : 1.0}
|
||||
{ "purchased.plan.paymentMethod" : 1.0}
|
||||
|
||||
guilds
|
||||
party.id
|
||||
challenges
|
||||
challenges:
|
||||
{ "_id" : 1.0 , "__v" : 1.0} ?
|
||||
{ "_id" : 1.0 , "official" : -1.0 , "timestamp" : -1.0}
|
||||
{ "group" : 1.0 , "official" : -1.0 , "timestamp" : -1.0}
|
||||
{ "leader" : 1.0 , "official" : -1.0 , "timestamp" : -1.0}
|
||||
{ "members" : 1.0 , "official" : -1.0 , "timestamp" : -1.0} ?
|
||||
{ "official" : -1 , "timestamp" : -1}
|
||||
{ "official" : -1 , "timestamp" : -1, "_id": 1} ?
|
||||
groups:
|
||||
{ "_id" : 1 , "quest.key" : 1}
|
||||
{ "_id" : 1.0 , "__v" : 1.0} ?
|
||||
{ "_id" : 1.0 , "privacy" : 1.0 , "members" : 1.0} ?
|
||||
{ "members" : 1.0 , "type" : 1.0 , "memberCount" : -1.0} ?
|
||||
{ "members" : 1} ?
|
||||
{ "privacy" : 1.0 , "memberCount" : -1.0} ?
|
||||
{ "privacy" : 1.0} ?
|
||||
{ "type" : 1 , "privacy" : 1} ?
|
||||
{ "type" : 1.0 , "members" : 1.0} ?
|
||||
{ "type" : 1} ?
|
||||
emailUnsubscriptions: email unique
|
||||
*/
|
||||
Reference in New Issue
Block a user