Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
113 commits
Select commit Hold shift + click to select a range
4b93edb
feat: project init
Dec 15, 2024
6a89a22
feat: project init
Dec 15, 2024
8a0c5d0
feat: project init
Dec 15, 2024
6dded56
Merge pull request #1 from llcfishstat/detached8
Dec 15, 2024
63653ac
feat: project init
Dec 15, 2024
0e06297
feat: project init
Dec 15, 2024
448659c
Merge pull request #2 from llcfishstat/detached2
Dec 15, 2024
50e475d
feat: project init
Dec 18, 2024
cf4c61b
feat: project init
Dec 18, 2024
01cb9c6
Merge pull request #3 from llcfishstat/detached5
Dec 18, 2024
dd3ee5c
feat: project init
Dec 18, 2024
9481975
feat: project init
Dec 18, 2024
89898ce
feat: project init
Dec 18, 2024
ce0eea1
feat: project init
Dec 18, 2024
9c1a4b7
feat: project init
Dec 18, 2024
e237624
feat: project init
Dec 19, 2024
db68401
feat: project init
Dec 19, 2024
3067814
feat: project init
Dec 19, 2024
de9d6b1
feat: project init
Dec 19, 2024
cf2208f
feat: project init
Dec 19, 2024
520f516
feat: project init
Dec 19, 2024
6b81c9e
feat: project init
Dec 19, 2024
7136c6c
feat: project init
Dec 19, 2024
7f3dc88
feat: project init
Dec 19, 2024
0ed4355
feat: project init
Dec 19, 2024
926262a
Merge pull request #4 from llcfishstat/detached20
Dec 19, 2024
9106d4e
feat: project init
Dec 19, 2024
4b04a96
feat: project init
Dec 19, 2024
8e6831f
feat: project init
Dec 19, 2024
7fd469d
feat: project init
Dec 19, 2024
0caedda
feat: project init
Dec 19, 2024
80d026e
feat: Mail Service complete
Dec 19, 2024
575cad4
feat: Mail Service complete
Dec 19, 2024
387bd80
Ваше сообщение коммита
Dec 20, 2024
eb7b423
Ваше сообщение коммита
Dec 20, 2024
c5c146d
Merge pull request #5 from llcfishstat/detached31
Dec 20, 2024
4f313ca
feat: Auth Service complete
Dec 20, 2024
48238c5
feat: Auth Service complete
Dec 20, 2024
e576804
feat: Auth Service complete
Dec 20, 2024
26e766c
feat: Auth Service complete
Dec 24, 2024
e83c6e5
Merge pull request #6 from llcfishstat/detached36
Dec 24, 2024
6cf669f
feat: Auth Service complete
Dec 24, 2024
9ba394d
Merge pull request #7 from llcfishstat/detached41
Dec 24, 2024
b5c219d
feat: add auction and chat submodule
Jan 10, 2025
071e3d5
feat: add auction and chat submodule
Jan 10, 2025
f3304b5
feat: add auction and chat submodule
Jan 10, 2025
4889093
feat: add auction and chat submodule
Jan 10, 2025
c6c05e5
feat: add auction and chat submodule
Jan 10, 2025
c739a29
feat: add auction and chat submodule
Jan 10, 2025
70a40ab
feat: add auction and chat submodule
Jan 10, 2025
4e2a7d1
feat: add auction and chat submodule
Jan 10, 2025
fa9169a
feat: add auction and chat submodule
Jan 10, 2025
6d5ea13
feat: add auction and chat submodule
Jan 10, 2025
5b9e4a8
Merge pull request #8 from llcfishstat/detached82
Jan 10, 2025
c42c181
Merge pull request #9 from llcfishstat/detached83
Jan 10, 2025
237c37e
feat: add auction and chat submodule
Jan 10, 2025
3da99cf
feat: add chat redis user
Jan 14, 2025
eed5cc7
feat: add chat redis user
Jan 14, 2025
c6cd11a
feat: add chat redis user
Jan 14, 2025
503005a
feat: add chat redis user
Jan 14, 2025
28a7c75
feat: add chat redis user
Jan 14, 2025
204ee2c
feat: add chat users by id
Jan 14, 2025
4ac8ea7
feat: fix chat cors
Jan 16, 2025
6b9fa03
feat: add chat types
Jan 16, 2025
4547812
feat: add chat types
Jan 16, 2025
43db904
feat: add chat types
Jan 16, 2025
bf1e2ec
feat: add chat types
Jan 16, 2025
4b8bf7e
feat: add chat types
Jan 16, 2025
3ab6e24
feat: add get users by companyId
Jan 16, 2025
07b3d5b
feat: add get users by companyId
Jan 16, 2025
7266f39
feat: add get users by companyId
Jan 16, 2025
52f2643
feat: add get users by companyId
Jan 16, 2025
8d5f255
feat: add get users by organizationName
Jan 17, 2025
aaab5f7
feat: add get users by organizationName
Jan 17, 2025
dc20aec
feat: post service update and auctions
Jan 18, 2025
6261e00
feat: auth change email and phone
Jan 19, 2025
ee04eaf
feat: auth change email and phone
Jan 19, 2025
3c5183e
feat: auth change email and phone
Jan 19, 2025
c764e99
feat: auth change email and phone
Jan 19, 2025
2302105
feat: fix README.md
Jan 21, 2025
7fc51db
feat: fix README.md
Jan 21, 2025
abf18b0
feat: fix company
Jan 21, 2025
19671e8
feat: fix company
Jan 22, 2025
070a02b
Merge pull request #10 from llcfishstat/detached116
Jan 22, 2025
eb1d48a
feat: fix company
Jan 22, 2025
a335187
Merge pull request #11 from llcfishstat/detached118
Jan 22, 2025
a810903
feat: add documents to company
Jan 22, 2025
078e30d
Merge pull request #12 from llcfishstat/detached120
Jan 22, 2025
aa29257
feat: add documents to company
Jan 22, 2025
7c418a1
Merge pull request #13 from llcfishstat/detached121
Jan 22, 2025
5118447
feat: add documents to company
Jan 22, 2025
1058a56
feat: add documents to company
Jan 22, 2025
4206392
Merge pull request #14 from llcfishstat/detached123
Jan 22, 2025
aaf178f
fix queue
Jan 24, 2025
5233a50
Merge pull request #15 from llcfishstat/detached128
Jan 24, 2025
55ea45a
feat: queue fix
Jan 24, 2025
083a2d9
feat: queue fix
Jan 24, 2025
7231ffb
Merge pull request #16 from llcfishstat/detached132
Jan 24, 2025
1ac119d
remove test handler
Jan 25, 2025
6a24b8d
add search by companyId
Jan 25, 2025
814519c
add message handler
Jan 25, 2025
a3e251d
add get compnies ids handler
Jan 25, 2025
4d51446
add payload
Jan 25, 2025
66b7f5b
add userId to login
Jan 25, 2025
8a74949
add userId to login
Jan 25, 2025
87a622e
fix search company
Jan 27, 2025
a091445
feat: add get all companies id
thavguard Jan 27, 2025
d4613b0
change cookie domain
Jan 27, 2025
f01a68f
Merge remote-tracking branch 'origin/main'
Jan 27, 2025
43e3353
feat: add logo to companyDto
thavguard Feb 5, 2025
f93e2ff
Merge branch 'main' of https://github.com/llcfishstat/auth
thavguard Feb 5, 2025
9642e0c
feat: add notifications
thavguard Feb 17, 2025
2531b94
feat: add message pattern
thavguard Feb 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
node_modules
dist
*.log
17 changes: 14 additions & 3 deletions .env.docker
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
APP_NAME="@backendworks/auth"
APP_NAME="@fishstat/auth"
APP_ENV="development"

HTTP_ENABLE=true
Expand All @@ -7,8 +7,6 @@ HTTP_PORT=9001
HTTP_VERSIONING_ENABLE=true
HTTP_VERSION=1

DATABASE_URL="postgresql://admin:master123@postgres:5432/auth_db?schema=public"

ACCESS_TOKEN_SECRET_KEY="testme"
ACCESS_TOKEN_EXPIRED="1d"
REFRESH_TOKEN_SECRET_KEY="testme"
Expand All @@ -17,3 +15,16 @@ REFRESH_TOKEN_EXPIRED="7d"
RABBITMQ_URL="amqp://admin:master123@rabbitmq:5672"
RABBITMQ_AUTH_QUEUE="auth_queue"

SMTP_HOST="smtp.yandex.ru"
SMTP_PORT=465
YANDEX_EMAIL="support@fishstat.ru"
YANDEX_PASSWORD="cswkkzrmaojmabnm"

ZVONOK_API_PUBLIC_KEY="13c01ce7a99a619b0d6f8c39cf6fedb6"
ZVONOK_CAMPAIGN_ID="832327028"
ZVONOK_FLASH_CALL_URL="https://zvonok.com/manager/cabapi_external/api/v1/phones/flashcall/"

DATABASE_URL="postgresql://admin:master123@postgres:5432/auth_db?schema=public"

CORS_ORIGIN=http://localhost:8888
TZ=Europe/Moscow
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,5 @@ lerna-debug.log*
!.vscode/launch.json
!.vscode/extensions.json
.env
.idea

7 changes: 5 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
FROM node:20-alpine
FROM node:20-bullseye-slim AS builder

ENV TZ=UTC

WORKDIR /app

COPY package.json yarn.lock ./

COPY prisma ./prisma

RUN yarn install --frozen-lockfile
Expand All @@ -11,4 +14,4 @@ COPY . .

EXPOSE 9001

CMD [ "yarn", "dev" ]
CMD [ "yarn", "dev" ]
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Description
## Auth Submodule Service

[Nest](https://github.com/nestjs/nest) Microservice framework auth service TypeScript repository.

Expand Down
2 changes: 1 addition & 1 deletion buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ phases:
- docker push $REPOSITORY_URI:latest
- docker push $REPOSITORY_URI:$IMAGE_TAG
- echo Writing image definitions file...
- printf '[{"name":"backendworks-auth","imageUri":"%s"}]' "$REPOSITORY_URI:$IMAGE_TAG" > imagedefinitions.json
- printf '[{"name":"fishstat-auth","imageUri":"%s"}]' "$REPOSITORY_URI:$IMAGE_TAG" > imagedefinitions.json
- cat imagedefinitions.json

artifacts:
Expand Down
2 changes: 1 addition & 1 deletion ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ COPY --from=builder /app/prisma /app/prisma

RUN yarn install --production --frozen-lockfile

EXPOSE 9001
EXPOSE 9005

CMD [ "yarn", "start" ]
5 changes: 5 additions & 0 deletions nest-cli.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
"include": "languages/**/*",
"outDir": "dist",
"watchAssets": true
},
{
"include": "templates/**/*",
"outDir": "dist",
"watchAssets": true
}
],
"deleteOutDir": true,
Expand Down
22 changes: 18 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@backendworks/auth",
"name": "@fishstat/auth",
"version": "2.0.0",
"private": true,
"engines": {
Expand All @@ -8,8 +8,8 @@
},
"scripts": {
"prebuild": "rimraf dist",
"build": "nest build",
"build:prod": "nest build",
"build": "nest build && copyfiles -u 1 'src/templates/**/*' dist/common/templates/",
"build:prod": "nest build && copyfiles -u 1 'src/templates/**/*' dist/common/templates/",
"format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"",
"start": "node dist/main",
"dev": "nest start --watch",
Expand All @@ -23,6 +23,7 @@
},
"dependencies": {
"@faker-js/faker": "^9.1.0",
"@nestjs/axios": "^3.1.3",
"@nestjs/common": "^10.4.6",
"@nestjs/config": "^3.3.0",
"@nestjs/core": "^10.4.6",
Expand All @@ -33,19 +34,32 @@
"@nestjs/swagger": "^8.0.1",
"@nestjs/terminus": "^10.2.3",
"@prisma/client": "^5.21.1",
"@types/bcryptjs": "^2.4.6",
"@types/cookie-parser": "^1.4.8",
"@types/nodemailer": "^6.4.17",
"@types/request-ip": "^0.0.41",
"amqp-connection-manager": "^4.1.14",
"amqplib": "^0.10.4",
"axios": "^1.7.9",
"bcrypt": "^5.1.1",
"bcryptjs": "^2.4.3",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"cookie-parser": "^1.4.7",
"copyfiles": "^2.4.1",
"date-fns": "^4.1.0",
"dotenv": "^16.4.5",
"express": "^4.21.1",
"handlebars": "^4.7.8",
"helmet": "^8.0.0",
"nestjs-i18n": "^10.4.9",
"nodemailer": "^6.9.16",
"passport": "^0.7.0",
"passport-jwt": "^4.0.1",
"reflect-metadata": "^0.2.2",
"rxjs": "^7.8.1"
"request-ip": "^3.3.0",
"rxjs": "^7.8.1",
"uuid": "^11.0.3"
},
"devDependencies": {
"@nestjs/cli": "^10.4.5",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/*
Warnings:

- You are about to drop the column `is_verified` on the `users` table. All the data in the column will be lost.

*/
-- AlterTable
ALTER TABLE "users" DROP COLUMN "is_verified",
ADD COLUMN "is_email_verified" BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN "is_phone_verified" BOOLEAN NOT NULL DEFAULT false,
ADD COLUMN "patronymic" TEXT;
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/*
Warnings:

- A unique constraint covering the columns `[verification]` on the table `users` will be added. If there are existing duplicate values, this will fail.
- Added the required column `verification` to the `users` table without a default value. This is not possible if the table is not empty.

*/
-- AlterTable
ALTER TABLE "users" ADD COLUMN "verification" TEXT NOT NULL;

-- CreateIndex
CREATE UNIQUE INDEX "users_verification_key" ON "users"("verification");
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- AlterTable
ALTER TABLE "users" ADD COLUMN "block_expires" TIMESTAMP(3),
ADD COLUMN "login_attempts" INTEGER NOT NULL DEFAULT 0,
ADD COLUMN "verification_expires" TIMESTAMP(3),
ALTER COLUMN "verification" DROP NOT NULL;
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
Warnings:

- A unique constraint covering the columns `[phone_number]` on the table `users` will be added. If there are existing duplicate values, this will fail.

*/
-- CreateIndex
CREATE UNIQUE INDEX "users_phone_number_key" ON "users"("phone_number");
16 changes: 16 additions & 0 deletions prisma/migrations/20241220101655_add_phone_code/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-- CreateTable
CREATE TABLE "PhoneCode" (
"id" TEXT NOT NULL,
"userId" TEXT NOT NULL,
"phoneCodeHash" TEXT NOT NULL,
"requestCount" INTEGER NOT NULL DEFAULT 0,
"lastSentAt" TIMESTAMP(3),
"expiresAt" TIMESTAMP(3),
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,

CONSTRAINT "PhoneCode_pkey" PRIMARY KEY ("id")
);

-- AddForeignKey
ALTER TABLE "PhoneCode" ADD CONSTRAINT "PhoneCode_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "PhoneCode" ADD COLUMN "blockedUntil" TIMESTAMP(3);
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
Warnings:

- You are about to drop the `PhoneCode` table. If the table is not empty, all the data it contains will be lost.

*/
-- DropForeignKey
ALTER TABLE "PhoneCode" DROP CONSTRAINT "PhoneCode_userId_fkey";

-- DropTable
DROP TABLE "PhoneCode";

-- CreateTable
CREATE TABLE "phone_code" (
"id" TEXT NOT NULL,
"userId" TEXT NOT NULL,
"phoneCodeHash" TEXT NOT NULL,
"requestCount" INTEGER NOT NULL DEFAULT 0,
"lastSentAt" TIMESTAMP(3),
"expiresAt" TIMESTAMP(3),
"blockedUntil" TIMESTAMP(3),
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,

CONSTRAINT "phone_code_pkey" PRIMARY KEY ("id")
);

-- AddForeignKey
ALTER TABLE "phone_code" ADD CONSTRAINT "phone_code_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "users" ALTER COLUMN "email" DROP NOT NULL;
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-- CreateTable
CREATE TABLE "forgot_passwords" (
"id" TEXT NOT NULL,
"email" TEXT NOT NULL,
"verification" TEXT NOT NULL,
"firstUsed" BOOLEAN NOT NULL DEFAULT false,
"finalUsed" BOOLEAN NOT NULL DEFAULT false,
"expires" TIMESTAMP(3) NOT NULL,
"ip" TEXT NOT NULL,
"browser" TEXT NOT NULL,
"country" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,

CONSTRAINT "forgot_passwords_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE UNIQUE INDEX "forgot_passwords_email_key" ON "forgot_passwords"("email");
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- AlterTable
ALTER TABLE "forgot_passwords" ADD COLUMN "browserChanged" TEXT,
ADD COLUMN "countryChanged" TEXT,
ADD COLUMN "ipChanged" TEXT;
25 changes: 25 additions & 0 deletions prisma/migrations/20241228113908_add_companies_table/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
-- CreateEnum
CREATE TYPE "CompanyVerificationStatus" AS ENUM ('UNVERIFIED', 'VERIFIED');

-- CreateTable
CREATE TABLE "Company" (
"id" TEXT NOT NULL,
"directorFirstName" TEXT NOT NULL,
"directorLastName" TEXT NOT NULL,
"directorPatronymic" TEXT,
"inn" TEXT,
"ogrn" TEXT,
"name" TEXT NOT NULL,
"country" TEXT,
"city" TEXT,
"legalAddress" TEXT,
"email" TEXT,
"phone" TEXT,
"description" TEXT,
"documentUrl" TEXT,
"status" "CompanyVerificationStatus" NOT NULL DEFAULT 'UNVERIFIED',
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,

CONSTRAINT "Company_pkey" PRIMARY KEY ("id")
);
19 changes: 19 additions & 0 deletions prisma/migrations/20241228120819_add_user_companies/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
-- CreateTable
CREATE TABLE "user_company" (
"id" TEXT NOT NULL,
"userId" TEXT NOT NULL,
"companyId" TEXT NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,

CONSTRAINT "user_company_pkey" PRIMARY KEY ("id")
);

-- CreateIndex
CREATE UNIQUE INDEX "user_company_userId_companyId_key" ON "user_company"("userId", "companyId");

-- AddForeignKey
ALTER TABLE "user_company" ADD CONSTRAINT "user_company_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "user_company" ADD CONSTRAINT "user_company_companyId_fkey" FOREIGN KEY ("companyId") REFERENCES "Company"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Company" ADD COLUMN "logoUrl" TEXT;
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
Warnings:

- You are about to drop the `Company` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `user_company` table. If the table is not empty, all the data it contains will be lost.

*/
-- DropForeignKey
ALTER TABLE "user_company" DROP CONSTRAINT "user_company_companyId_fkey";

-- DropForeignKey
ALTER TABLE "user_company" DROP CONSTRAINT "user_company_userId_fkey";

-- AlterTable
ALTER TABLE "users" ADD COLUMN "companyId" TEXT;

-- DropTable
DROP TABLE "Company";

-- DropTable
DROP TABLE "user_company";

-- CreateTable
CREATE TABLE "companies" (
"id" TEXT NOT NULL,
"directorFirstName" TEXT NOT NULL,
"directorLastName" TEXT NOT NULL,
"directorPatronymic" TEXT NOT NULL,
"inn" TEXT NOT NULL,
"ogrn" TEXT NOT NULL,
"organizationName" TEXT NOT NULL,
"country" TEXT,
"city" TEXT,
"legalAddress" TEXT NOT NULL,
"email" TEXT NOT NULL,
"phone" TEXT NOT NULL,
"description" TEXT NOT NULL,
"documentUrl" TEXT NOT NULL,
"logoUrl" TEXT,
"status" "CompanyVerificationStatus" NOT NULL DEFAULT 'UNVERIFIED',
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,

CONSTRAINT "companies_pkey" PRIMARY KEY ("id")
);

-- AddForeignKey
ALTER TABLE "users" ADD CONSTRAINT "users_companyId_fkey" FOREIGN KEY ("companyId") REFERENCES "companies"("id") ON DELETE SET NULL ON UPDATE CASCADE;
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-- CreateEnum
CREATE TYPE "CompanyRequestStatus" AS ENUM ('PENDING', 'APPROVED', 'DECLINED');

-- CreateTable
CREATE TABLE "company_requests" (
"id" TEXT NOT NULL,
"userId" TEXT NOT NULL,
"companyId" TEXT NOT NULL,
"status" "CompanyRequestStatus" NOT NULL DEFAULT 'PENDING',
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,

CONSTRAINT "company_requests_pkey" PRIMARY KEY ("id")
);

-- AddForeignKey
ALTER TABLE "company_requests" ADD CONSTRAINT "company_requests_userId_fkey" FOREIGN KEY ("userId") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

-- AddForeignKey
ALTER TABLE "company_requests" ADD CONSTRAINT "company_requests_companyId_fkey" FOREIGN KEY ("companyId") REFERENCES "companies"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
Loading