Skip to content

Live and Dev Database

Annika Muecke edited this page Jul 5, 2022 · 1 revision

Our firebase project includes two separate databases, the default one is called handball-performance-tracker, and is intended to be used in production use. For possible bigger restructurings and backend-heavy new features, one can switch to handball-tracker-dev, which does not include any real user data (and consequently breaking it wouldn't be too critical).

For that purpose, a small adaption to the code needs to be made:

  • go to data/DatabaseRepository.dart where the _db instance for reading from/writing to the database is stored
  • for using the default database, final FirebaseFirestore _db = FirebaseFirestore.instance; should be commented in
  • to switch to the dev database: comment in final FirebaseFirestore _db = FirebaseFirestore.instanceFor(app: Firebase.app('dev')); (line 22), comment out the default line
  • Careful: currently only works for testing in Web, as switching the configuration for Android and IOS also requires switching of the corresponding configuration files as described in the firebase SDK setup

Clone this wiki locally