Skip to content

Commit 7f3814f

Browse files
committed
merge the new chnages
2 parents 05590ef + eaa95db commit 7f3814f

9 files changed

Lines changed: 253 additions & 79 deletions

File tree

.env.example

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,13 @@ DATABASE_URL=
44

55
# Direct connection to the database. Used for migrations
66
DIRECT_URL=
7+
8+
# Supabase URL
9+
SUPABASE_URL=
10+
11+
# Supabase service role key
12+
SUPABASE_SERVICE_ROLE_KEY=
13+
14+
# Environment variables for the application
15+
NODE_ENV=development
16+

bun.lock

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jest.config.js

Lines changed: 0 additions & 9 deletions
This file was deleted.

jest.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
export default {
3+
preset: 'ts-jest',
4+
testEnvironment: 'node',
5+
moduleFileExtensions: ['ts', 'js', 'json'],
6+
testMatch: ['**/tests/**/*.test.ts'],
7+
}

package.json

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,15 @@
88
},
99
"scripts": {
1010
"test": "jest",
11-
"apidoc": "apidoc -c apidoc.json"
12-
11+
"apidoc": "apidoc -c apidoc.json",
12+
"start" : "bun run src/server.ts",
13+
"lint": "eslint src/",
14+
"format": "prettier --write src/",
15+
"lint:fix": "eslint src/ --fix",
16+
"precommit": "lint-staged",
17+
"migrate:first":"bunx prisma migrate dev --name init",
18+
"migrate": "bunx prisma migrate dev",
19+
"generate": "bunx prisma generate"
1320
},
1421
"repository": {
1522
"type": "git",
@@ -31,20 +38,20 @@
3138
"eslint-config-prettier": "^10.1.5",
3239
"eslint-plugin-prettier": "^5.5.1",
3340
"globals": "^16.3.0",
41+
"jest-mock-extended": "^4.0.0",
3442
"lint-staged": "^16.1.2",
3543
"prettier": "^3.6.2",
3644
"prisma": "^6.11.1",
3745
"ts-node-dev": "^2.0.0",
3846
"typescript": "^5.8.3",
47+
"@types/jest": "^30.0.0",
3948
"typescript-eslint": "^8.36.0"
4049
},
4150
"dependencies": {
4251
"@prisma/client": "^6.11.1",
4352
"@supabase/supabase-js": "^2.50.5",
44-
"@types/bun": "^1.2.18",
4553
"@types/cors": "^2.8.19",
4654
"@types/express": "^5.0.3",
47-
"@types/jest": "^30.0.0",
4855
"@types/multer": "^2.0.0",
4956
"@types/node": "^24.0.13",
5057
"apidoc": "^1.2.0",
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/*
2+
Warnings:
3+
4+
- Added the required column `description` to the `Achievement` table without a default value. This is not possible if the table is not empty.
5+
- Added the required column `updatedAt` to the `Achievement` table without a default value. This is not possible if the table is not empty.
6+
- Made the column `imageUrl` on table `Achievement` required. This step will fail if there are existing NULL values in that column.
7+
- Added the required column `updatedAt` to the `Project` table without a default value. This is not possible if the table is not empty.
8+
- Added the required column `updatedAt` to the `Question` table without a default value. This is not possible if the table is not empty.
9+
10+
*/
11+
-- AlterTable
12+
ALTER TABLE "Achievement" ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
13+
ADD COLUMN "createdById" TEXT,
14+
ADD COLUMN "description" TEXT NOT NULL,
15+
ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL,
16+
ADD COLUMN "updatedById" TEXT,
17+
ALTER COLUMN "imageUrl" SET NOT NULL;
18+
19+
-- AlterTable
20+
ALTER TABLE "Member" ADD COLUMN "approvedById" TEXT;
21+
22+
-- AlterTable
23+
ALTER TABLE "Project" ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
24+
ADD COLUMN "createdById" TEXT,
25+
ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL,
26+
ADD COLUMN "updatedById" TEXT;
27+
28+
-- AlterTable
29+
ALTER TABLE "Question" ADD COLUMN "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
30+
ADD COLUMN "updatedAt" TIMESTAMP(3) NOT NULL,
31+
ADD COLUMN "updatedById" TEXT;
32+
33+
-- AlterTable
34+
ALTER TABLE "Topic" ADD COLUMN "updatedById" TEXT;
35+
36+
-- AddForeignKey
37+
ALTER TABLE "Member" ADD CONSTRAINT "Member_approvedById_fkey" FOREIGN KEY ("approvedById") REFERENCES "Member"("id") ON DELETE SET NULL ON UPDATE CASCADE;
38+
39+
-- AddForeignKey
40+
ALTER TABLE "Achievement" ADD CONSTRAINT "Achievement_createdById_fkey" FOREIGN KEY ("createdById") REFERENCES "Member"("id") ON DELETE SET NULL ON UPDATE CASCADE;
41+
42+
-- AddForeignKey
43+
ALTER TABLE "Achievement" ADD CONSTRAINT "Achievement_updatedById_fkey" FOREIGN KEY ("updatedById") REFERENCES "Member"("id") ON DELETE SET NULL ON UPDATE CASCADE;
44+
45+
-- AddForeignKey
46+
ALTER TABLE "Project" ADD CONSTRAINT "Project_createdById_fkey" FOREIGN KEY ("createdById") REFERENCES "Member"("id") ON DELETE SET NULL ON UPDATE CASCADE;
47+
48+
-- AddForeignKey
49+
ALTER TABLE "Project" ADD CONSTRAINT "Project_updatedById_fkey" FOREIGN KEY ("updatedById") REFERENCES "Member"("id") ON DELETE SET NULL ON UPDATE CASCADE;
50+
51+
-- AddForeignKey
52+
ALTER TABLE "Topic" ADD CONSTRAINT "Topic_updatedById_fkey" FOREIGN KEY ("updatedById") REFERENCES "Member"("id") ON DELETE SET NULL ON UPDATE CASCADE;
53+
54+
-- AddForeignKey
55+
ALTER TABLE "Question" ADD CONSTRAINT "Question_updatedById_fkey" FOREIGN KEY ("updatedById") REFERENCES "Member"("id") ON DELETE SET NULL ON UPDATE CASCADE;

0 commit comments

Comments
 (0)