feat(backend): Databank initialiseren
Verbinding met databank aangemaakt, eerste entities toegevoegd, centrale API aangemaakt om omgevingsvariabelen voor onze app op te vragen.
This commit is contained in:
		
							parent
							
								
									c07bb959cf
								
							
						
					
					
						commit
						62a278a6e0
					
				
					 8 changed files with 86 additions and 10 deletions
				
			
		
							
								
								
									
										6
									
								
								backend/src/entities/users/student.entity.ts
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								backend/src/entities/users/student.entity.ts
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,6 @@ | |||
| import {User} from "./user.entity"; | ||||
| import { Entity } from '@mikro-orm/core'; | ||||
| 
 | ||||
| @Entity() | ||||
| export class Student extends User { | ||||
| } | ||||
							
								
								
									
										7
									
								
								backend/src/entities/users/teacher.entity.ts
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										7
									
								
								backend/src/entities/users/teacher.entity.ts
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,7 @@ | |||
| import { Entity } from '@mikro-orm/core'; | ||||
| import {User} from "./user.entity"; | ||||
| 
 | ||||
| @Entity() | ||||
| export class Teacher extends User { | ||||
| 
 | ||||
| } | ||||
|  | @ -1,9 +1,9 @@ | |||
| import { Entity, PrimaryKey, Property } from '@mikro-orm/core'; | ||||
| 
 | ||||
| @Entity() | ||||
| @Entity({abstract: true}) | ||||
| export class User { | ||||
|     @PrimaryKey({ type: 'number' }) | ||||
|     id!: number; | ||||
|     @PrimaryKey({type: "string"}) | ||||
|     username!: string; | ||||
| 
 | ||||
|     @Property() | ||||
|     firstName: string = ''; | ||||
		Reference in a new issue
	
	 Gerald Schmittinger
						Gerald Schmittinger