mirror of
https://github.com/gitpod-io/gitpod.git
synced 2025-12-08 17:36:30 +00:00
This commit includes the following commits: - @iqqbot update dev image to nodejs v16lts - @iqqbot update dev-environment-image to use nodejs v16 - @iqqbot update component to nodejs v16 lts - [licensor] Adjust to v16 - [ts] Bump @types/node to ^16.11.0 accordingly - @aledbf Update typescript dependencies - @aledbf Update typescript configuration - @aledbf / @geropl Update typescript code - [server] Fix express/passport types - [db] typeorm upgrade 0.1.20 -> 0.2.22: fix compile and runtime issues - [db] typeorm upgrade 0.2.22 -> 0.2.38: fix compile and runtime issues - [dev] Upgrade amqplib and smaller libs - [dev] Upgrade uuid - [dev] Update probot - [dev] Final yarn.lock
Gitpod-db
Contains all the database related functionality, implemented using typeorm.
Adding a new table
- Create a migration - use the baseline as an exemplar
- Create a new entity that implements the requisite interface or extend an existing entity as required - see db-user.ts
- If it is a new table, create the matching injectable ORM implementation and interface (if required) - see user-db-impl.ts and user-db.ts. Otherwise extend the existing interface and implementation as required.
- Add the injectable implementation to the DB container module, binding the interface and implementation as appropriate, otherwise it will not be instantiated correctly e.g.
bind(TypeORMUserDBImpl).toSelf().inSingletonScope();
bind(UserDB).toService(TypeORMUserDBImpl);
- Add the new ORM as an injected component where required e.g. in user-controller.ts
@inject(UserDB) protected readonly userDb: UserDB;