-
-
Notifications
You must be signed in to change notification settings - Fork 407
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1055 from ONEARMY/feat/user-stats-migration
Feat/user stats migration
- Loading branch information
Showing
43 changed files
with
1,167 additions
and
2,057 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// React apps populate a process variable, however it might not always be accessible outside (e.g. cypress) | ||
const e = process ? process.env : ({} as any) | ||
/** | ||
* A prefix can be used to simplify large-scale schema changes or multisite hosting | ||
* and allow multiple sites to use one DB (used for parallel test seed DBs) | ||
* e.g. oa_ | ||
*/ | ||
const DB_PREFIX = e.REACT_APP_DB_PREFIX ? e.REACT_APP_DB_PREFIX : '' | ||
|
||
/** | ||
* Mapping of generic database endpoints to specific prefixed and revisioned versions for the | ||
* current implementation | ||
* @example | ||
* ``` | ||
* const allHowtos = await db.get(DB_ENDPOINTS.howtos) | ||
* ``` | ||
* NOTE - these are a bit messy due to various migrations and changes | ||
* In the future all endpoints should try to just retain prefix-base-revision, e.g. oa_users_rev20201012 | ||
*/ | ||
export const DB_ENDPOINTS = { | ||
howtos: `${DB_PREFIX}v3_howtos`, | ||
users: `${DB_PREFIX}v3_users`, | ||
tags: `${DB_PREFIX}v3_tags`, | ||
events: `${DB_PREFIX}v3_events`, | ||
mappins: `${DB_PREFIX}v3_mappins`, | ||
} | ||
export type DBEndpoint = keyof typeof DB_ENDPOINTS | ||
// legacy - want to use upper case naming convention but keep alternate until all code migrated | ||
export const DBEndpoints = DB_ENDPOINTS |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,4 +11,5 @@ lib/ | |
# Testing config files | ||
.runtimeconfig.json | ||
|
||
./firebase-debug.log | ||
./firebase-debug.log | ||
*.log |
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.