-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdatabase.ts
More file actions
60 lines (55 loc) · 1.59 KB
/
database.ts
File metadata and controls
60 lines (55 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
import { SQLiteDatabaseAdapter } from "@deepkit/sqlite";
import { Database } from "@deepkit/orm";
import { User } from "./User";
import { Address } from "./Address";
import { EmergencyContact } from "./EmergencyContact";
import { ParentContact } from "./ParentContact";
import { League } from "./League";
import { LeagueFormat } from "./LeagueFormat";
import { Draw } from "./Draw";
import { DrawTime } from "./DrawTime";
import { Division } from "./Division";
import { Invoice } from "./Invoice";
import { Match } from "./Match";
import { Team } from "./Team";
import { Sheet } from "./Sheet";
import { Player } from "./Player";
import { Club } from "./Club";
import { Season } from "./Season";
import { UserParentContact } from "./joinerObjects/UserParentContact";
import { LeagueMembership } from "./joinerObjects/LeagueMembership";
import { SpareCandidate } from "./joinerObjects/SpareCandidate";
import { LeagueTeam } from "./joinerObjects/LeagueTeam";
import { PlayerClub } from "./joinerObjects/PlayerClub";
import { AppConfig } from "../appConfig";
import path from "path";
export class TheBroomstackDatabase extends Database {
name = "default";
constructor(dbPath: AppConfig['dbPath']) {
super(new SQLiteDatabaseAdapter(path.resolve(__dirname, "..", "..", dbPath)), [
// Data objects
User,
Address,
EmergencyContact,
ParentContact,
League,
LeagueFormat,
Draw,
DrawTime,
Division,
Invoice,
Match,
Team,
Sheet,
Player,
Club,
Season,
// Association objects
UserParentContact,
LeagueMembership,
SpareCandidate,
LeagueTeam,
PlayerClub,
]);
}
}