-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e3eda2d
commit 10db08c
Showing
5 changed files
with
122 additions
and
3 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
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,20 @@ | ||
import { DataSource } from "typeorm"; | ||
|
||
export const DatabaseProviders = [ | ||
{ | ||
provide: "DATA_SOURCE", | ||
useFactory: async () => { | ||
const dataSource = new DataSource({ | ||
type: "postgres", | ||
host: "localhost", | ||
port: 5432, | ||
database: "postgres", | ||
password: "postgres", | ||
username: "postgres", | ||
entities: [__dirname + "./entities/**/*.ts"], | ||
synchronize: true, | ||
}); | ||
return dataSource.initialize(); | ||
}, | ||
}, | ||
]; |
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,70 @@ | ||
import { Entity, Column, PrimaryGeneratedColumn } from "typeorm"; | ||
|
||
@Entity() | ||
export class Student { | ||
@PrimaryGeneratedColumn() | ||
studentId: string; | ||
|
||
@Column({ type: "string" }) | ||
aadhaar: string; | ||
|
||
@Column({ type: "string" }) | ||
refStudentId: string; | ||
|
||
@Column({ type: "character varying" }) | ||
firstName: string; | ||
|
||
@Column({ type: "character varying" }) | ||
lastName: string; | ||
|
||
@Column({ type: "integer" }) | ||
contactNumber: number; | ||
|
||
@Column({ type: "string" }) | ||
email: string; | ||
|
||
@Column({ type: "character varying", length: 1 }) | ||
gender: string; | ||
|
||
@Column({ type: "character varying", length: 1 }) | ||
socialCategory: string; | ||
|
||
@Column({ type: "character varying", length: 1 }) | ||
iscwsn: string; | ||
|
||
@Column({ type: "character varying", length: 1 }) | ||
religion: string; | ||
|
||
@Column({ type: "character varying", length: 1 }) | ||
singleGirl: string; | ||
|
||
@Column({ type: "real" }) | ||
weight: number; | ||
|
||
@Column({ type: "real" }) | ||
height: number; | ||
|
||
@Column({ type: "character varying", length: 1 }) | ||
bloodGroup: string; | ||
|
||
@Column({ type: "date" }) | ||
birthDate: Date; | ||
|
||
@Column({ type: "character varying", length: 1 }) | ||
homeless: string; | ||
|
||
@Column({ type: "character varying", length: 1 }) | ||
bpl: string; | ||
|
||
@Column({ type: "character varying", length: 1 }) | ||
migrant: string; | ||
|
||
@Column({ type: "string" }) | ||
schoolId: string; | ||
|
||
@Column({ type: "string" }) | ||
classId: string; | ||
|
||
@Column({ type: "character varying", length: 1 }) | ||
status: string; | ||
} |
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,24 @@ | ||
export interface StudentInterface extends Document { | ||
readonly studentId: string; | ||
readonly aadhaar: string; | ||
readonly refStudentId: string; | ||
readonly firstName: string; | ||
readonly lastName: string; | ||
readonly contactNumber: number; | ||
readonly email: string; | ||
readonly gender: string; | ||
readonly socialCategory: string; | ||
readonly iscwsn: string; | ||
readonly religion: string; | ||
readonly singleGirl: string; | ||
readonly weight: number; | ||
readonly height: number; | ||
readonly bloodGroup: string; | ||
readonly birthDate: Date; | ||
readonly homeless: string; | ||
readonly bpl: string; | ||
readonly migrant: string; | ||
readonly schoolId: string; | ||
readonly classId: string; | ||
readonly status: string; | ||
} |