lang-database 1.9.0 → 2.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.
- package/.env-dev.example +3 -0
- package/.env-local.example +3 -0
- package/.env-prod.example +3 -0
- package/.env-test.example +3 -0
- package/generated/prisma-client/index-browser.js +20 -1
- package/generated/prisma-client/index.d.ts +3811 -771
- package/generated/prisma-client/index.js +21 -2
- package/generated/prisma-client/schema.prisma +30 -7
- package/migrations/{20221112124401_init → 20230607212052_}/migration.sql +55 -33
- package/migrations/20230607212301_teams_restricted_deck_fixed_typo/migration.sql +36 -0
- package/package.json +1 -1
- package/schema.prisma +30 -7
- package/.env-dev +0 -2
- package/.env-local +0 -2
- package/.env-prod +0 -3
- package/.env-test +0 -4
- package/migrations/20221112132548_id_fields_fix_in_cockroachdb/migration.sql +0 -158
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Warnings:
|
|
3
|
-
|
|
4
|
-
- You are about to alter the column `cardId` on the `answers` table. The data in that column will be cast from `Int` to `BigInt`. This cast may fail. Please make sure the data in the column can be cast.
|
|
5
|
-
- You are about to alter the column `id` on the `answers` table. The data in that column will be cast from `Int` to `BigInt`. This cast may fail. Please make sure the data in the column can be cast.
|
|
6
|
-
- You are about to alter the column `userId` on the `answers` table. The data in that column will be cast from `Int` to `BigInt`. This cast may fail. Please make sure the data in the column can be cast.
|
|
7
|
-
- You are about to alter the column `id` on the `cards` table. The data in that column will be cast from `Int` to `BigInt`. This cast may fail. Please make sure the data in the column can be cast.
|
|
8
|
-
- You are about to alter the column `packId` on the `cards` table. The data in that column will be cast from `Int` to `BigInt`. This cast may fail. Please make sure the data in the column can be cast.
|
|
9
|
-
- You are about to alter the column `id` on the `users` table. The data in that column will be cast from `Int` to `BigInt`. This cast may fail. Please make sure the data in the column can be cast.
|
|
10
|
-
- You are about to alter the column `id` on the `purchases` table. The data in that column will be cast from `Int` to `BigInt`. This cast may fail. Please make sure the data in the column can be cast.
|
|
11
|
-
- You are about to alter the column `packId` on the `purchases` table. The data in that column will be cast from `Int` to `BigInt`. This cast may fail. Please make sure the data in the column can be cast.
|
|
12
|
-
- You are about to alter the column `userId` on the `purchases` table. The data in that column will be cast from `Int` to `BigInt`. This cast may fail. Please make sure the data in the column can be cast.
|
|
13
|
-
- You are about to alter the column `id` on the `teachers` table. The data in that column will be cast from `Int` to `BigInt`. This cast may fail. Please make sure the data in the column can be cast.
|
|
14
|
-
- You are about to alter the column `id` on the `packs` table. The data in that column will be cast from `Int` to `BigInt`. This cast may fail. Please make sure the data in the column can be cast.
|
|
15
|
-
- You are about to alter the column `teacherId` on the `packs` table. The data in that column will be cast from `Int` to `BigInt`. This cast may fail. Please make sure the data in the column can be cast.
|
|
16
|
-
- Changed the type of `A` on the `_PackToUser` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
|
|
17
|
-
- Changed the type of `B` on the `_PackToUser` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
|
|
18
|
-
- Changed the type of `userId` on the `googleUsers` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
|
|
19
|
-
- Changed the type of `userId` on the `userCards` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
|
|
20
|
-
- Changed the type of `cardId` on the `userCards` table. No cast exists, the column would be dropped and recreated, which cannot be done if there is data, since the column is required.
|
|
21
|
-
|
|
22
|
-
*/
|
|
23
|
-
-- DropForeignKey
|
|
24
|
-
ALTER TABLE "_PackToUser" DROP CONSTRAINT "_PackToUser_A_fkey";
|
|
25
|
-
|
|
26
|
-
-- DropForeignKey
|
|
27
|
-
ALTER TABLE "_PackToUser" DROP CONSTRAINT "_PackToUser_B_fkey";
|
|
28
|
-
|
|
29
|
-
-- DropForeignKey
|
|
30
|
-
ALTER TABLE "googleUsers" DROP CONSTRAINT "googleUsers_userId_fkey";
|
|
31
|
-
|
|
32
|
-
-- DropForeignKey
|
|
33
|
-
ALTER TABLE "userCards" DROP CONSTRAINT "userCards_cardId_fkey";
|
|
34
|
-
|
|
35
|
-
-- DropForeignKey
|
|
36
|
-
ALTER TABLE "userCards" DROP CONSTRAINT "userCards_userId_fkey";
|
|
37
|
-
|
|
38
|
-
-- AlterTable
|
|
39
|
-
ALTER TABLE "_PackToUser" DROP COLUMN "A";
|
|
40
|
-
ALTER TABLE "_PackToUser" ADD COLUMN "A" INT8 NOT NULL;
|
|
41
|
-
ALTER TABLE "_PackToUser" DROP COLUMN "B";
|
|
42
|
-
ALTER TABLE "_PackToUser" ADD COLUMN "B" INT8 NOT NULL;
|
|
43
|
-
|
|
44
|
-
-- AlterTable
|
|
45
|
-
ALTER TABLE "googleUsers" DROP COLUMN "userId";
|
|
46
|
-
ALTER TABLE "googleUsers" ADD COLUMN "userId" INT8 NOT NULL;
|
|
47
|
-
|
|
48
|
-
-- AlterTable
|
|
49
|
-
ALTER TABLE "userCards" DROP COLUMN "userId";
|
|
50
|
-
ALTER TABLE "userCards" ADD COLUMN "userId" INT8 NOT NULL;
|
|
51
|
-
ALTER TABLE "userCards" DROP COLUMN "cardId";
|
|
52
|
-
ALTER TABLE "userCards" ADD COLUMN "cardId" INT8 NOT NULL;
|
|
53
|
-
|
|
54
|
-
-- RedefineTables
|
|
55
|
-
CREATE TABLE "_prisma_new_answers" (
|
|
56
|
-
"id" INT8 NOT NULL DEFAULT unique_rowid(),
|
|
57
|
-
"userId" INT8 NOT NULL,
|
|
58
|
-
"cardId" INT8 NOT NULL,
|
|
59
|
-
"status" STRING NOT NULL,
|
|
60
|
-
"timestamp" STRING NOT NULL,
|
|
61
|
-
|
|
62
|
-
CONSTRAINT "answers_pkey" PRIMARY KEY ("id")
|
|
63
|
-
);
|
|
64
|
-
INSERT INTO "_prisma_new_answers" ("cardId","id","status","timestamp","userId") SELECT "cardId","id","status","timestamp","userId" FROM "answers";
|
|
65
|
-
DROP TABLE "answers" CASCADE;
|
|
66
|
-
ALTER TABLE "_prisma_new_answers" RENAME TO "answers";
|
|
67
|
-
ALTER TABLE "answers" ADD CONSTRAINT "answers_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
68
|
-
ALTER TABLE "answers" ADD CONSTRAINT "answers_cardId_fkey" FOREIGN KEY ("cardId") REFERENCES "cards"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
69
|
-
CREATE TABLE "_prisma_new_cards" (
|
|
70
|
-
"id" INT8 NOT NULL DEFAULT unique_rowid(),
|
|
71
|
-
"packId" INT8 NOT NULL,
|
|
72
|
-
"front" STRING NOT NULL,
|
|
73
|
-
"back" STRING NOT NULL,
|
|
74
|
-
|
|
75
|
-
CONSTRAINT "cards_pkey" PRIMARY KEY ("id")
|
|
76
|
-
);
|
|
77
|
-
DROP INDEX "cards_packId_back_key";
|
|
78
|
-
DROP INDEX "cards_packId_front_key";
|
|
79
|
-
INSERT INTO "_prisma_new_cards" ("back","front","id","packId") SELECT "back","front","id","packId" FROM "cards";
|
|
80
|
-
DROP TABLE "cards" CASCADE;
|
|
81
|
-
ALTER TABLE "_prisma_new_cards" RENAME TO "cards";
|
|
82
|
-
CREATE UNIQUE INDEX "cards_packId_front_key" ON "cards"("packId", "front");
|
|
83
|
-
CREATE UNIQUE INDEX "cards_packId_back_key" ON "cards"("packId", "back");
|
|
84
|
-
ALTER TABLE "cards" ADD CONSTRAINT "cards_packId_fkey" FOREIGN KEY ("packId") REFERENCES "packs"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
85
|
-
CREATE TABLE "_prisma_new_users" (
|
|
86
|
-
"id" INT8 NOT NULL DEFAULT unique_rowid(),
|
|
87
|
-
"email" STRING NOT NULL,
|
|
88
|
-
"name" STRING NOT NULL,
|
|
89
|
-
|
|
90
|
-
CONSTRAINT "users_pkey" PRIMARY KEY ("id")
|
|
91
|
-
);
|
|
92
|
-
DROP INDEX "IX_Users_Email";
|
|
93
|
-
INSERT INTO "_prisma_new_users" ("email","id","name") SELECT "email","id","name" FROM "users";
|
|
94
|
-
DROP TABLE "users" CASCADE;
|
|
95
|
-
ALTER TABLE "_prisma_new_users" RENAME TO "users";
|
|
96
|
-
CREATE UNIQUE INDEX "IX_Users_Email" ON "users"("email");
|
|
97
|
-
CREATE TABLE "_prisma_new_purchases" (
|
|
98
|
-
"id" INT8 NOT NULL DEFAULT unique_rowid(),
|
|
99
|
-
"userId" INT8 NOT NULL,
|
|
100
|
-
"packId" INT8 NOT NULL,
|
|
101
|
-
"price" STRING NOT NULL,
|
|
102
|
-
|
|
103
|
-
CONSTRAINT "purchases_pkey" PRIMARY KEY ("id")
|
|
104
|
-
);
|
|
105
|
-
INSERT INTO "_prisma_new_purchases" ("id","packId","price","userId") SELECT "id","packId","price","userId" FROM "purchases";
|
|
106
|
-
DROP TABLE "purchases" CASCADE;
|
|
107
|
-
ALTER TABLE "_prisma_new_purchases" RENAME TO "purchases";
|
|
108
|
-
ALTER TABLE "purchases" ADD CONSTRAINT "purchases_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
109
|
-
ALTER TABLE "purchases" ADD CONSTRAINT "purchases_packId_fkey" FOREIGN KEY ("packId") REFERENCES "packs"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
110
|
-
CREATE TABLE "_prisma_new_teachers" (
|
|
111
|
-
"id" INT8 NOT NULL DEFAULT unique_rowid(),
|
|
112
|
-
"email" STRING NOT NULL,
|
|
113
|
-
"name" STRING NOT NULL,
|
|
114
|
-
"password" STRING NOT NULL,
|
|
115
|
-
|
|
116
|
-
CONSTRAINT "teachers_pkey" PRIMARY KEY ("id")
|
|
117
|
-
);
|
|
118
|
-
DROP INDEX "IX_teachers_Email";
|
|
119
|
-
INSERT INTO "_prisma_new_teachers" ("email","id","name","password") SELECT "email","id","name","password" FROM "teachers";
|
|
120
|
-
DROP TABLE "teachers" CASCADE;
|
|
121
|
-
ALTER TABLE "_prisma_new_teachers" RENAME TO "teachers";
|
|
122
|
-
CREATE UNIQUE INDEX "IX_teachers_Email" ON "teachers"("email");
|
|
123
|
-
CREATE TABLE "_prisma_new_packs" (
|
|
124
|
-
"id" INT8 NOT NULL DEFAULT unique_rowid(),
|
|
125
|
-
"teacherId" INT8 NOT NULL,
|
|
126
|
-
"name" STRING NOT NULL,
|
|
127
|
-
"currentPrice" DECIMAL(65,30) NOT NULL,
|
|
128
|
-
|
|
129
|
-
CONSTRAINT "packs_pkey" PRIMARY KEY ("id")
|
|
130
|
-
);
|
|
131
|
-
INSERT INTO "_prisma_new_packs" ("currentPrice","id","name","teacherId") SELECT "currentPrice","id","name","teacherId" FROM "packs";
|
|
132
|
-
DROP TABLE "packs" CASCADE;
|
|
133
|
-
ALTER TABLE "_prisma_new_packs" RENAME TO "packs";
|
|
134
|
-
ALTER TABLE "packs" ADD CONSTRAINT "packs_teacherId_fkey" FOREIGN KEY ("teacherId") REFERENCES "teachers"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
135
|
-
|
|
136
|
-
-- CreateIndex
|
|
137
|
-
CREATE UNIQUE INDEX "_PackToUser_AB_unique" ON "_PackToUser"("A", "B");
|
|
138
|
-
|
|
139
|
-
-- CreateIndex
|
|
140
|
-
CREATE INDEX "_PackToUser_B_index" ON "_PackToUser"("B");
|
|
141
|
-
|
|
142
|
-
-- CreateIndex
|
|
143
|
-
CREATE UNIQUE INDEX "googleUsers_userId_key" ON "googleUsers"("userId");
|
|
144
|
-
|
|
145
|
-
-- AddForeignKey
|
|
146
|
-
ALTER TABLE "userCards" ADD CONSTRAINT "userCards_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
147
|
-
|
|
148
|
-
-- AddForeignKey
|
|
149
|
-
ALTER TABLE "userCards" ADD CONSTRAINT "userCards_cardId_fkey" FOREIGN KEY ("cardId") REFERENCES "cards"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
150
|
-
|
|
151
|
-
-- AddForeignKey
|
|
152
|
-
ALTER TABLE "googleUsers" ADD CONSTRAINT "googleUsers_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
|
|
153
|
-
|
|
154
|
-
-- AddForeignKey
|
|
155
|
-
ALTER TABLE "_PackToUser" ADD CONSTRAINT "_PackToUser_A_fkey" FOREIGN KEY ("A") REFERENCES "packs"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
|
156
|
-
|
|
157
|
-
-- AddForeignKey
|
|
158
|
-
ALTER TABLE "_PackToUser" ADD CONSTRAINT "_PackToUser_B_fkey" FOREIGN KEY ("B") REFERENCES "users"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|