-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.types.ts
More file actions
106 lines (98 loc) · 2.54 KB
/
database.types.ts
File metadata and controls
106 lines (98 loc) · 2.54 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import type { Generated, Insertable, Selectable } from 'kysely';
export interface RegionTable {
id: Generated<number>;
name: string;
translations: string | null;
created_at: string | null;
updated_at: string;
flag: number;
wikiDataId: string | null;
}
export interface SubregionTable {
id: Generated<number>;
name: string;
translations: string | null;
region_id: number;
created_at: string | null;
updated_at: string;
flag: number;
wikiDataId: string | null;
}
export interface CountryTable {
id: Generated<number>;
name: string;
iso3: string | null;
numeric_code: string | null;
iso2: string | null;
phonecode: string | null;
capital: string | null;
currency: string | null;
currency_name: string | null;
currency_symbol: string | null;
tld: string | null;
native: string | null;
region: string | null;
region_id: number | null;
subregion: string | null;
subregion_id: number | null;
nationality: string | null;
timezones: string | null;
translations: string | null;
latitude: number | null;
longitude: number | null;
emoji: string | null;
emojiU: string | null;
created_at: string | null;
updated_at: string;
flag: number;
wikiDataId: string | null;
}
export interface StateTable {
id: Generated<number>;
name: string;
country_id: number;
country_code: string;
fips_code: string | null;
iso2: string | null;
type: string | null;
level: number | null;
parent_id: number | null;
native: string | null;
latitude: number | null;
longitude: number | null;
created_at: string | null;
updated_at: string;
flag: number;
wikiDataId: string | null;
}
export interface CityTable {
id: Generated<number>;
name: string;
state_id: number;
state_code: string;
country_id: number;
country_code: string;
latitude: number;
longitude: number;
created_at: string;
updated_at: string;
flag: number;
wikiDataId: string | null;
}
export interface Database {
regions: RegionTable;
subregions: SubregionTable;
countries: CountryTable;
states: StateTable;
cities: CityTable;
}
export type RegionRow = Selectable<RegionTable>;
export type SubregionRow = Selectable<SubregionTable>;
export type CountryRow = Selectable<CountryTable>;
export type StateRow = Selectable<StateTable>;
export type CityRow = Selectable<CityTable>;
export type NewRegion = Insertable<RegionTable>;
export type NewSubregion = Insertable<SubregionTable>;
export type NewCountry = Insertable<CountryTable>;
export type NewState = Insertable<StateTable>;
export type NewCity = Insertable<CityTable>;