|
1 | | -// This is your Prisma schema file, |
2 | | -// learn more about it in the docs: https://pris.ly/d/prisma-schema |
3 | | - |
4 | 1 | generator client { |
5 | | - provider = "prisma-client-js" |
| 2 | + provider = "prisma-client-js" |
6 | 3 | } |
7 | 4 |
|
8 | 5 | datasource db { |
9 | | - provider = "postgresql" |
10 | | - url = env("DATABASE_URL") |
11 | | - directUrl = env("DIRECT_URL") |
12 | | - relationMode = "prisma" |
| 6 | + provider = "postgresql" |
| 7 | + url = env("DATABASE_URL") |
| 8 | + relationMode = "prisma" |
13 | 9 | } |
14 | 10 |
|
15 | | -// Game models |
16 | | - |
17 | 11 | model PaUsers { |
18 | | - id Int @id @default(autoincrement()) |
19 | | - nick String |
20 | | - crystal Int @default(0) |
21 | | - metal Int @default(0) |
22 | | - energy Int @default(0) |
23 | | - construction PaConstruct? @relation(fields: [paConstructId], references: [id]) |
24 | | - r_energy Int @default(0) |
25 | | - sats Int @default(0) |
26 | | - infinitys Int @default(0) |
27 | | - wraiths Int @default(0) |
28 | | - warfrigs Int @default(0) |
29 | | - destroyers Int @default(0) |
30 | | - scorpions Int @default(0) |
31 | | - astropods Int @default(0) |
32 | | - cobras Int @default(0) |
33 | | - infinitys_base Int @default(0) |
34 | | - wraiths_base Int @default(0) |
35 | | - warfrigs_base Int @default(0) |
36 | | - destroyers_base Int @default(0) |
37 | | - scorpions_base Int @default(0) |
38 | | - astropods_base Int @default(0) |
39 | | - cobras_base Int @default(0) |
40 | | - p_scorpions Int @default(0) |
41 | | - p_scorpions_eta Int @default(0) |
42 | | - p_cobras Int @default(0) |
43 | | - p_cobras_eta Int @default(0) |
44 | | - missiles Int @default(0) |
45 | | - score Int @default(0) |
46 | | - asteroids Int @default(0) |
47 | | - asteroid_crystal Int @default(0) |
48 | | - asteroid_metal Int @default(0) |
49 | | - ui_roids Int @default(0) |
50 | | - war Int @default(0) |
51 | | - def Int @default(0) |
52 | | - wareta Int @default(0) |
53 | | - defeta Int @default(0) |
54 | | - r_imcrystal Int @default(0) |
55 | | - r_immetal Int @default(0) |
56 | | - r_iafs Int @default(0) |
57 | | - r_aaircraft Int @default(0) |
58 | | - r_tbeam Int @default(0) |
59 | | - r_uscan Int @default(0) |
60 | | - r_oscan Int @default(0) |
61 | | - p_infinitys Int @default(0) |
62 | | - p_infinitys_eta Int @default(0) |
63 | | - p_wraiths Int @default(0) |
64 | | - p_wraiths_eta Int @default(0) |
65 | | - p_warfrigs Int @default(0) |
66 | | - p_warfrigs_eta Int @default(0) |
67 | | - p_destroyers Int @default(0) |
68 | | - p_destroyers_eta Int @default(0) |
69 | | - p_missiles Int @default(0) |
70 | | - p_missiles_eta Int @default(0) |
71 | | - timer Int @default(0) |
72 | | - size Int @default(0) |
73 | | - p_astropods Int @default(0) |
74 | | - p_astropods_eta Int @default(0) |
75 | | - tag String @default("") |
76 | | - rank Int @default(0) |
77 | | - rcannons Int @default(0) |
78 | | - p_rcannons Int @default(0) |
79 | | - p_rcannons_eta Int @default(0) |
80 | | - avengers Int @default(0) |
81 | | - p_avengers Int @default(0) |
82 | | - p_avengers_eta Int @default(0) |
83 | | - lstalkers Int @default(0) |
84 | | - p_lstalkers Int @default(0) |
85 | | - p_lstalkers_eta Int @default(0) |
86 | | - r_odg Int @default(0) |
87 | | - sleep Int @default(0) |
88 | | - lastsleep Int @default(0) |
89 | | - closed Int @default(0) |
90 | | - x Int @default(1) |
91 | | - y Int @default(1) |
92 | | - commander Int @default(0) |
93 | | - galname String @default("No name") |
94 | | - galpic String @default("125x125earthdoom1.gif") |
95 | | - motd Int @default(0) |
96 | | - vote String @default("") |
97 | | - civilians Int @default(1000) |
98 | | - tax Int @default(20) |
99 | | - credits Int @default(5000) |
100 | | - newbie Int @default(100) |
101 | | - paConstructId Int? |
102 | | -
|
103 | | - @@unique([nick]) |
104 | | - @@index([nick]) |
105 | | - @@index([paConstructId]) |
| 12 | + id Int @id @default(autoincrement()) |
| 13 | + nick String @unique |
| 14 | + crystal Int @default(0) |
| 15 | + metal Int @default(0) |
| 16 | + energy Int @default(0) |
| 17 | + r_energy Int @default(0) |
| 18 | + sats Int @default(0) |
| 19 | + infinitys Int @default(0) |
| 20 | + wraiths Int @default(0) |
| 21 | + warfrigs Int @default(0) |
| 22 | + destroyers Int @default(0) |
| 23 | + scorpions Int @default(0) |
| 24 | + astropods Int @default(0) |
| 25 | + cobras Int @default(0) |
| 26 | + infinitys_base Int @default(0) |
| 27 | + wraiths_base Int @default(0) |
| 28 | + warfrigs_base Int @default(0) |
| 29 | + destroyers_base Int @default(0) |
| 30 | + scorpions_base Int @default(0) |
| 31 | + astropods_base Int @default(0) |
| 32 | + cobras_base Int @default(0) |
| 33 | + p_scorpions Int @default(0) |
| 34 | + p_scorpions_eta Int @default(0) |
| 35 | + p_cobras Int @default(0) |
| 36 | + p_cobras_eta Int @default(0) |
| 37 | + missiles Int @default(0) |
| 38 | + score Int @default(0) |
| 39 | + asteroids Int @default(0) |
| 40 | + asteroid_crystal Int @default(0) |
| 41 | + asteroid_metal Int @default(0) |
| 42 | + ui_roids Int @default(0) |
| 43 | + war Int @default(0) |
| 44 | + def Int @default(0) |
| 45 | + wareta Int @default(0) |
| 46 | + defeta Int @default(0) |
| 47 | + r_imcrystal Int @default(0) |
| 48 | + r_immetal Int @default(0) |
| 49 | + r_iafs Int @default(0) |
| 50 | + r_aaircraft Int @default(0) |
| 51 | + r_tbeam Int @default(0) |
| 52 | + r_uscan Int @default(0) |
| 53 | + r_oscan Int @default(0) |
| 54 | + p_infinitys Int @default(0) |
| 55 | + p_infinitys_eta Int @default(0) |
| 56 | + p_wraiths Int @default(0) |
| 57 | + p_wraiths_eta Int @default(0) |
| 58 | + p_warfrigs Int @default(0) |
| 59 | + p_warfrigs_eta Int @default(0) |
| 60 | + p_destroyers Int @default(0) |
| 61 | + p_destroyers_eta Int @default(0) |
| 62 | + p_missiles Int @default(0) |
| 63 | + p_missiles_eta Int @default(0) |
| 64 | + timer Int @default(0) |
| 65 | + size Int @default(0) |
| 66 | + p_astropods Int @default(0) |
| 67 | + p_astropods_eta Int @default(0) |
| 68 | + tag String @default("") |
| 69 | + rank Int @default(0) |
| 70 | + rcannons Int @default(0) |
| 71 | + p_rcannons Int @default(0) |
| 72 | + p_rcannons_eta Int @default(0) |
| 73 | + avengers Int @default(0) |
| 74 | + p_avengers Int @default(0) |
| 75 | + p_avengers_eta Int @default(0) |
| 76 | + lstalkers Int @default(0) |
| 77 | + p_lstalkers Int @default(0) |
| 78 | + p_lstalkers_eta Int @default(0) |
| 79 | + r_odg Int @default(0) |
| 80 | + sleep Int @default(0) |
| 81 | + lastsleep Int @default(0) |
| 82 | + closed Int @default(0) |
| 83 | + x Int @default(1) |
| 84 | + y Int @default(1) |
| 85 | + commander Int @default(0) |
| 86 | + galname String @default("No name") |
| 87 | + galpic String @default("125x125earthdoom1.gif") |
| 88 | + motd Int @default(0) |
| 89 | + vote String @default("") |
| 90 | + civilians Int @default(1000) |
| 91 | + tax Int @default(20) |
| 92 | + credits Int @default(5000) |
| 93 | + newbie Int @default(100) |
| 94 | + paConstructId Int? |
| 95 | + construction PaConstruct? @relation(fields: [paConstructId], references: [id]) |
| 96 | +
|
| 97 | + @@index([nick]) |
| 98 | + @@index([paConstructId]) |
106 | 99 | } |
107 | 100 |
|
108 | 101 | model PaConstruct { |
109 | | - id Int @id @default(autoincrement()) |
110 | | - c_crystal Int @default(0) |
111 | | - c_metal Int @default(0) |
112 | | - c_airport Int @default(0) |
113 | | - c_abase Int @default(0) |
114 | | - c_wstation Int @default(0) |
115 | | - c_amp1 Int @default(0) |
116 | | - c_amp2 Int @default(0) |
117 | | - c_warfactory Int @default(0) |
118 | | - c_destfact Int @default(0) |
119 | | - c_scorpfact Int @default(0) |
120 | | - c_energy Int @default(0) |
121 | | - c_odg Int @default(0) |
122 | | - PaUsers PaUsers[] |
123 | | -
|
124 | | - @@index([id]) |
| 102 | + id Int @id @default(autoincrement()) |
| 103 | + c_crystal Int @default(0) |
| 104 | + c_metal Int @default(0) |
| 105 | + c_airport Int @default(0) |
| 106 | + c_abase Int @default(0) |
| 107 | + c_wstation Int @default(0) |
| 108 | + c_amp1 Int @default(0) |
| 109 | + c_amp2 Int @default(0) |
| 110 | + c_warfactory Int @default(0) |
| 111 | + c_destfact Int @default(0) |
| 112 | + c_scorpfact Int @default(0) |
| 113 | + c_energy Int @default(0) |
| 114 | + c_odg Int @default(0) |
| 115 | + PaUsers PaUsers[] |
| 116 | +
|
| 117 | + @@index([id]) |
125 | 118 | } |
126 | 119 |
|
127 | 120 | model PaNews { |
128 | | - id Int @id @default(autoincrement()) |
129 | | - sentTo Int @default(0) |
130 | | - time Int @default(0) |
131 | | - news String @db.Text |
132 | | - seen String @default("") |
133 | | - header String |
134 | | -
|
135 | | - @@index([sentTo]) |
| 121 | + id Int @id @default(autoincrement()) |
| 122 | + sentTo Int @default(0) |
| 123 | + time Int @default(0) |
| 124 | + news String |
| 125 | + seen String @default("") |
| 126 | + header String |
| 127 | +
|
| 128 | + @@index([sentTo]) |
136 | 129 | } |
137 | 130 |
|
138 | 131 | model PaLogging { |
139 | | - id Int @id @default(autoincrement()) |
140 | | - subject String |
141 | | - text String |
142 | | - author Int @default(0) |
143 | | - stamp Int @default(0) |
144 | | - toid Int @default(0) |
145 | | - type String |
146 | | - ip String |
| 132 | + id Int @id @default(autoincrement()) |
| 133 | + subject String |
| 134 | + text String |
| 135 | + author Int @default(0) |
| 136 | + stamp Int @default(0) |
| 137 | + toid Int @default(0) |
| 138 | + type String |
| 139 | + ip String |
147 | 140 | } |
148 | 141 |
|
149 | 142 | model PaTag { |
150 | | - id Int @id @default(autoincrement()) |
151 | | - tag String |
152 | | - leader String |
153 | | - password String |
| 143 | + id Int @id @default(autoincrement()) |
| 144 | + tag String |
| 145 | + leader String |
| 146 | + password String |
154 | 147 |
|
155 | | - @@unique([tag, password]) |
156 | | - @@index([tag, password]) |
| 148 | + @@unique([tag, password]) |
| 149 | + @@index([tag, password]) |
157 | 150 | } |
158 | 151 |
|
159 | 152 | model PaMail { |
160 | | - id Int @id @default(autoincrement()) |
161 | | - // sentFrom String |
162 | | - sentTo Int @default(0) |
163 | | - time Int @default(0) |
164 | | - news String |
165 | | - seen Int @default(0) |
166 | | - header String |
167 | | -
|
168 | | - @@index([sentTo]) |
| 153 | + id Int @id @default(autoincrement()) |
| 154 | + sentTo Int @default(0) |
| 155 | + time Int @default(0) |
| 156 | + news String |
| 157 | + seen Int @default(0) |
| 158 | + header String |
| 159 | +
|
| 160 | + @@index([sentTo]) |
169 | 161 | } |
170 | 162 |
|
171 | 163 | model PaPolitics { |
172 | | - id Int @id @default(autoincrement()) |
173 | | - time Int @default(0) |
174 | | - tekst String |
175 | | - x Int @default(1) |
176 | | - creator String |
177 | | - threadid String |
178 | | - header String |
| 164 | + id Int @id @default(autoincrement()) |
| 165 | + time Int @default(0) |
| 166 | + tekst String |
| 167 | + x Int @default(1) |
| 168 | + creator String |
| 169 | + threadid String |
| 170 | + header String |
179 | 171 | } |
180 | 172 |
|
181 | 173 | model PaAlliance { |
182 | | - id Int @id @default(autoincrement()) |
183 | | - time Int @default(0) |
184 | | - tekst String |
185 | | - alliance String |
186 | | - creator String |
187 | | - threadid String |
188 | | - header String |
| 174 | + id Int @id @default(autoincrement()) |
| 175 | + time Int @default(0) |
| 176 | + tekst String |
| 177 | + alliance String |
| 178 | + creator String |
| 179 | + threadid String |
| 180 | + header String |
189 | 181 | } |
190 | 182 |
|
191 | 183 | model PaSession { |
192 | | - id Int @id @default(autoincrement()) |
193 | | - nick String |
194 | | - userid Int |
195 | | - magicnumber String @default("0") |
| 184 | + id Int @id @default(autoincrement()) |
| 185 | + nick String |
| 186 | + userid Int |
| 187 | + magicnumber String @default("0") |
196 | 188 | } |
197 | 189 |
|
198 | 190 | model PaWar { |
199 | | - id Int @id @default(autoincrement()) |
200 | | - attacker Int |
201 | | - defender Int |
| 191 | + id Int @id @default(autoincrement()) |
| 192 | + attacker Int |
| 193 | + defender Int |
202 | 194 | } |
203 | 195 |
|
204 | 196 | model Reset { |
205 | | - id Int @id @default(autoincrement()) |
206 | | - nextreset Int @default(10080) |
207 | | - game_start Int @default(0) |
208 | | - game_reset Int @default(1) |
| 197 | + id Int @id @default(autoincrement()) |
| 198 | + nextreset Int @default(10080) |
| 199 | + game_start Int @default(0) |
| 200 | + game_reset Int @default(1) |
209 | 201 | } |
0 commit comments