lang-database 12.1.1 → 13.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Warnings:
|
|
3
|
+
|
|
4
|
+
- You are about to drop the column `amount` on the `purchases` table. All the data in the column will be lost.
|
|
5
|
+
- You are about to drop the column `currency` on the `purchases` table. All the data in the column will be lost.
|
|
6
|
+
- You are about to drop the column `orderDate` on the `purchases` table. All the data in the column will be lost.
|
|
7
|
+
- You are about to drop the column `packId` on the `purchases` table. All the data in the column will be lost.
|
|
8
|
+
- You are about to drop the column `paymentDate` on the `purchases` table. All the data in the column will be lost.
|
|
9
|
+
- You are about to drop the column `status` on the `purchases` table. All the data in the column will be lost.
|
|
10
|
+
- Added the required column `acknowledged` to the `purchases` table without a default value. This is not possible if the table is not empty.
|
|
11
|
+
- Added the required column `createdAt` to the `purchases` table without a default value. This is not possible if the table is not empty.
|
|
12
|
+
- Added the required column `expirationDate` to the `purchases` table without a default value. This is not possible if the table is not empty.
|
|
13
|
+
- Added the required column `purchaseToken` to the `purchases` table without a default value. This is not possible if the table is not empty.
|
|
14
|
+
- Added the required column `sku` to the `purchases` table without a default value. This is not possible if the table is not empty.
|
|
15
|
+
- Added the required column `state` to the `purchases` table without a default value. This is not possible if the table is not empty.
|
|
16
|
+
- Added the required column `updatedAt` to the `purchases` table without a default value. This is not possible if the table is not empty.
|
|
17
|
+
|
|
18
|
+
*/
|
|
19
|
+
-- CreateEnum
|
|
20
|
+
CREATE TYPE "PurchaseState" AS ENUM ('PENDING', 'COMPLETED', 'REFUNDED', 'FAILED');
|
|
21
|
+
|
|
22
|
+
-- DropForeignKey
|
|
23
|
+
ALTER TABLE "purchases" DROP CONSTRAINT "purchases_packId_fkey";
|
|
24
|
+
|
|
25
|
+
-- AlterTable
|
|
26
|
+
ALTER TABLE "purchases" DROP COLUMN "amount",
|
|
27
|
+
DROP COLUMN "currency",
|
|
28
|
+
DROP COLUMN "orderDate",
|
|
29
|
+
DROP COLUMN "packId",
|
|
30
|
+
DROP COLUMN "paymentDate",
|
|
31
|
+
DROP COLUMN "status",
|
|
32
|
+
ADD COLUMN "acknowledged" BOOLEAN NOT NULL,
|
|
33
|
+
ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL,
|
|
34
|
+
ADD COLUMN "expirationDate" TIMESTAMP(3) NOT NULL,
|
|
35
|
+
ADD COLUMN "purchaseToken" TEXT NOT NULL,
|
|
36
|
+
ADD COLUMN "sku" TEXT NOT NULL,
|
|
37
|
+
ADD COLUMN "state" "PurchaseState" NOT NULL,
|
|
38
|
+
ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL;
|
|
39
|
+
|
|
40
|
+
-- DropEnum
|
|
41
|
+
DROP TYPE "PurchaseStatus";
|
package/package.json
CHANGED
package/schema.prisma
CHANGED
|
@@ -92,7 +92,6 @@ model Pack {
|
|
|
92
92
|
public Boolean @default(false)
|
|
93
93
|
userDecks UserDeck[]
|
|
94
94
|
cards Card[]
|
|
95
|
-
purchases Purchase[]
|
|
96
95
|
teams Team[]
|
|
97
96
|
@@map("packs")
|
|
98
97
|
}
|
|
@@ -186,22 +185,24 @@ enum Answer {
|
|
|
186
185
|
UNKNOWN
|
|
187
186
|
}
|
|
188
187
|
|
|
189
|
-
enum
|
|
188
|
+
enum PurchaseState {
|
|
190
189
|
PENDING
|
|
191
|
-
|
|
190
|
+
COMPLETED
|
|
191
|
+
REFUNDED
|
|
192
|
+
FAILED
|
|
192
193
|
}
|
|
193
194
|
|
|
194
195
|
model Purchase {
|
|
195
196
|
id String @id @default(cuid())
|
|
196
197
|
user User @relation(fields: [userId], references: [id])
|
|
197
198
|
userId String
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
199
|
+
purchaseToken String
|
|
200
|
+
sku String
|
|
201
|
+
state PurchaseState
|
|
202
|
+
acknowledged Boolean
|
|
203
|
+
expirationDate DateTime
|
|
204
|
+
createdAt DateTime
|
|
205
|
+
updatedAt DateTime
|
|
205
206
|
|
|
206
207
|
@@map("purchases")
|
|
207
208
|
}
|