forked from ucberkeley/Beehive
-
Notifications
You must be signed in to change notification settings - Fork 3
Database
Rick Zhang edited this page Aug 11, 2020
·
1 revision
The database schema is actually quite obtuse, with plenty of deprecated functionality. But then again, this is true for most production systems in the world, so don't worry too much about it. You can read the schema in /db/schema.rb, which is a generated file (aka do not edit manually). Instead, if you need to make a schema change, use Rails migrations.
Our database is a Postgres instance hosted on AWS RDS (Relational Database Service). There are good reasons that we do not simply create a separate Docker container and handle it ourselves. Those good reasons are:
- We don't want to wipe all the data by accident with a bad config.
- The lifecycle of the database should not be tied to the lifecycle of the application server. Very infrequently do we ever need to touch anything related to the database on AWS.
Note: you need to have completed the first-time setup routine.
rails console
u = User.find_by(email: [your email])
u.user_type = 5
u.save
Congrats, you will now see the Statistics and Admin tabs.