mirror of
https://gitea.gofwd.group/dstrawsb/ballistic-builder.git
synced 2025-12-06 02:36:44 -05:00
Merge branch 'develop' of ssh://gitea.gofwd.group:2225/dstrawsb/ballistic-builder into develop
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
import 'dotenv/config';
|
import 'dotenv/config';
|
||||||
import { defineConfig } from 'drizzle-kit';
|
import { defineConfig } from 'drizzle-kit';
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
out: './src/drizzle',
|
out: './src/drizzle/schema/',
|
||||||
schema: './src/db/schema/',
|
schema: './src/drizzle/schema/',
|
||||||
dialect: 'postgresql',
|
dialect: 'postgresql',
|
||||||
dbCredentials: {
|
dbCredentials: {
|
||||||
url: process.env.DATABASE_URL!,
|
url: process.env.DATABASE_URL!,
|
||||||
|
|||||||
250
package-lock.json
generated
250
package-lock.json
generated
@@ -24,7 +24,6 @@
|
|||||||
"class-variance-authority": "^0.7.0",
|
"class-variance-authority": "^0.7.0",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"dotenv": "^16.4.7",
|
"dotenv": "^16.4.7",
|
||||||
"drizzle-orm": "^0.36.4",
|
|
||||||
"fontsource-roboto": "^4.0.0",
|
"fontsource-roboto": "^4.0.0",
|
||||||
"framer-motion": "^11.11.17",
|
"framer-motion": "^11.11.17",
|
||||||
"lucide-react": "^0.460.0",
|
"lucide-react": "^0.460.0",
|
||||||
@@ -38,6 +37,7 @@
|
|||||||
"tailwindcss-animate": "^1.0.7"
|
"tailwindcss-animate": "^1.0.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@auth/drizzle-adapter": "^1.7.4",
|
||||||
"@types/bun": "^1.1.13",
|
"@types/bun": "^1.1.13",
|
||||||
"@types/node": "^20.17.6",
|
"@types/node": "^20.17.6",
|
||||||
"@types/pg": "^8.11.10",
|
"@types/pg": "^8.11.10",
|
||||||
@@ -45,8 +45,10 @@
|
|||||||
"@types/react-dom": "^18",
|
"@types/react-dom": "^18",
|
||||||
"autoprefixer": "^10.4.20",
|
"autoprefixer": "^10.4.20",
|
||||||
"drizzle-kit": "^0.28.1",
|
"drizzle-kit": "^0.28.1",
|
||||||
|
"drizzle-orm": "^0.38.2",
|
||||||
"eslint": "^8",
|
"eslint": "^8",
|
||||||
"eslint-config-next": "15.0.3",
|
"eslint-config-next": "15.0.3",
|
||||||
|
"next-auth": "^5.0.0-beta.25",
|
||||||
"postcss": "^8",
|
"postcss": "^8",
|
||||||
"tailwindcss": "^3.4.15",
|
"tailwindcss": "^3.4.15",
|
||||||
"tsx": "^4.19.2",
|
"tsx": "^4.19.2",
|
||||||
@@ -64,6 +66,99 @@
|
|||||||
"url": "https://github.com/sponsors/sindresorhus"
|
"url": "https://github.com/sponsors/sindresorhus"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@auth/core": {
|
||||||
|
"version": "0.37.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/@auth/core/-/core-0.37.2.tgz",
|
||||||
|
"integrity": "sha512-kUvzyvkcd6h1vpeMAojK2y7+PAV5H+0Cc9+ZlKYDFhDY31AlvsB+GW5vNO4qE3Y07KeQgvNO9U0QUx/fN62kBw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"@panva/hkdf": "^1.2.1",
|
||||||
|
"@types/cookie": "0.6.0",
|
||||||
|
"cookie": "0.7.1",
|
||||||
|
"jose": "^5.9.3",
|
||||||
|
"oauth4webapi": "^3.0.0",
|
||||||
|
"preact": "10.11.3",
|
||||||
|
"preact-render-to-string": "5.2.3"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@simplewebauthn/browser": "^9.0.1",
|
||||||
|
"@simplewebauthn/server": "^9.0.2",
|
||||||
|
"nodemailer": "^6.8.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@simplewebauthn/browser": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"@simplewebauthn/server": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"nodemailer": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@auth/core/node_modules/preact": {
|
||||||
|
"version": "10.11.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/preact/-/preact-10.11.3.tgz",
|
||||||
|
"integrity": "sha512-eY93IVpod/zG3uMF22Unl8h9KkrcKIRs2EGar8hwLZZDU1lkjph303V9HZBwufh2s736U6VXuhD109LYqPoffg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/preact"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@auth/drizzle-adapter": {
|
||||||
|
"version": "1.7.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@auth/drizzle-adapter/-/drizzle-adapter-1.7.4.tgz",
|
||||||
|
"integrity": "sha512-OPZQakWWm5Hbx6okVMbtgI08WBliz/dCbFUXiPg9TThpp3Wh7MME/ubg4fW1oOp8P0gul6MkFvMVO733sVtd2w==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"@auth/core": "0.37.4"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@auth/drizzle-adapter/node_modules/@auth/core": {
|
||||||
|
"version": "0.37.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/@auth/core/-/core-0.37.4.tgz",
|
||||||
|
"integrity": "sha512-HOXJwXWXQRhbBDHlMU0K/6FT1v+wjtzdKhsNg0ZN7/gne6XPsIrjZ4daMcFnbq0Z/vsAbYBinQhhua0d77v7qw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"@panva/hkdf": "^1.2.1",
|
||||||
|
"jose": "^5.9.6",
|
||||||
|
"oauth4webapi": "^3.1.1",
|
||||||
|
"preact": "10.24.3",
|
||||||
|
"preact-render-to-string": "6.5.11"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@simplewebauthn/browser": "^9.0.1",
|
||||||
|
"@simplewebauthn/server": "^9.0.2",
|
||||||
|
"nodemailer": "^6.8.0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@simplewebauthn/browser": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"@simplewebauthn/server": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"nodemailer": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@auth/drizzle-adapter/node_modules/preact-render-to-string": {
|
||||||
|
"version": "6.5.11",
|
||||||
|
"resolved": "https://registry.npmjs.org/preact-render-to-string/-/preact-render-to-string-6.5.11.tgz",
|
||||||
|
"integrity": "sha512-ubnauqoGczeGISiOh6RjX0/cdaF8v/oDXIjO85XALCQjwQP+SB4RDXXtvZ6yTYSjG+PC1QRP2AhPgCEsM2EvUw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"peerDependencies": {
|
||||||
|
"preact": ">=10"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@babel/code-frame": {
|
"node_modules/@babel/code-frame": {
|
||||||
"version": "7.26.2",
|
"version": "7.26.2",
|
||||||
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz",
|
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.26.2.tgz",
|
||||||
@@ -2544,6 +2639,16 @@
|
|||||||
"node": ">=12.4.0"
|
"node": ">=12.4.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@panva/hkdf": {
|
||||||
|
"version": "1.2.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/@panva/hkdf/-/hkdf-1.2.1.tgz",
|
||||||
|
"integrity": "sha512-6oclG6Y3PiDFcoyk8srjLfVKyMfVCKJ27JwNPViuXziFpmdz+MZnZN/aKY0JGXgYuO/VghU0jcOAZgWXZ1Dmrw==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/panva"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@pkgjs/parseargs": {
|
"node_modules/@pkgjs/parseargs": {
|
||||||
"version": "0.11.0",
|
"version": "0.11.0",
|
||||||
"resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",
|
"resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz",
|
||||||
@@ -2566,6 +2671,7 @@
|
|||||||
"version": "5.22.0",
|
"version": "5.22.0",
|
||||||
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.22.0.tgz",
|
"resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.22.0.tgz",
|
||||||
"integrity": "sha512-M0SVXfyHnQREBKxCgyo7sffrKttwE6R8PMq330MIUF0pTwjUhLbW84pFDlf06B27XyCR++VtjugEnIHdr07SVA==",
|
"integrity": "sha512-M0SVXfyHnQREBKxCgyo7sffrKttwE6R8PMq330MIUF0pTwjUhLbW84pFDlf06B27XyCR++VtjugEnIHdr07SVA==",
|
||||||
|
"dev": true,
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"peer": true,
|
"peer": true,
|
||||||
@@ -2585,6 +2691,7 @@
|
|||||||
"version": "5.22.0",
|
"version": "5.22.0",
|
||||||
"resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.22.0.tgz",
|
"resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.22.0.tgz",
|
||||||
"integrity": "sha512-AUt44v3YJeggO2ZU5BkXI7M4hu9BF2zzH2iF2V5pyXT/lRTyWiElZ7It+bRH1EshoMRxHgpYg4VB6rCM+mG5jQ==",
|
"integrity": "sha512-AUt44v3YJeggO2ZU5BkXI7M4hu9BF2zzH2iF2V5pyXT/lRTyWiElZ7It+bRH1EshoMRxHgpYg4VB6rCM+mG5jQ==",
|
||||||
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"peer": true
|
"peer": true
|
||||||
},
|
},
|
||||||
@@ -2592,6 +2699,7 @@
|
|||||||
"version": "5.22.0",
|
"version": "5.22.0",
|
||||||
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.22.0.tgz",
|
"resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.22.0.tgz",
|
||||||
"integrity": "sha512-UNjfslWhAt06kVL3CjkuYpHAWSO6L4kDCVPegV6itt7nD1kSJavd3vhgAEhjglLJJKEdJ7oIqDJ+yHk6qO8gPA==",
|
"integrity": "sha512-UNjfslWhAt06kVL3CjkuYpHAWSO6L4kDCVPegV6itt7nD1kSJavd3vhgAEhjglLJJKEdJ7oIqDJ+yHk6qO8gPA==",
|
||||||
|
"dev": true,
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"peer": true,
|
"peer": true,
|
||||||
@@ -2606,6 +2714,7 @@
|
|||||||
"version": "5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2",
|
"version": "5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2",
|
||||||
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2.tgz",
|
"resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.22.0-44.605197351a3c8bdd595af2d2a9bc3025bca48ea2.tgz",
|
||||||
"integrity": "sha512-2PTmxFR2yHW/eB3uqWtcgRcgAbG1rwG9ZriSvQw+nnb7c4uCr3RAcGMb6/zfE88SKlC1Nj2ziUvc96Z379mHgQ==",
|
"integrity": "sha512-2PTmxFR2yHW/eB3uqWtcgRcgAbG1rwG9ZriSvQw+nnb7c4uCr3RAcGMb6/zfE88SKlC1Nj2ziUvc96Z379mHgQ==",
|
||||||
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"peer": true
|
"peer": true
|
||||||
},
|
},
|
||||||
@@ -2613,6 +2722,7 @@
|
|||||||
"version": "5.22.0",
|
"version": "5.22.0",
|
||||||
"resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.22.0.tgz",
|
"resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.22.0.tgz",
|
||||||
"integrity": "sha512-bkrD/Mc2fSvkQBV5EpoFcZ87AvOgDxbG99488a5cexp5Ccny+UM6MAe/UFkUC0wLYD9+9befNOqGiIJhhq+HbA==",
|
"integrity": "sha512-bkrD/Mc2fSvkQBV5EpoFcZ87AvOgDxbG99488a5cexp5Ccny+UM6MAe/UFkUC0wLYD9+9befNOqGiIJhhq+HbA==",
|
||||||
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"peer": true,
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -2625,6 +2735,7 @@
|
|||||||
"version": "5.22.0",
|
"version": "5.22.0",
|
||||||
"resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.22.0.tgz",
|
"resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.22.0.tgz",
|
||||||
"integrity": "sha512-pHhpQdr1UPFpt+zFfnPazhulaZYCUqeIcPpJViYoq9R+D/yw4fjE+CtnsnKzPYm0ddUbeXUzjGVGIRVgPDCk4Q==",
|
"integrity": "sha512-pHhpQdr1UPFpt+zFfnPazhulaZYCUqeIcPpJViYoq9R+D/yw4fjE+CtnsnKzPYm0ddUbeXUzjGVGIRVgPDCk4Q==",
|
||||||
|
"dev": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"peer": true,
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
@@ -2814,6 +2925,13 @@
|
|||||||
"bun-types": "1.1.34"
|
"bun-types": "1.1.34"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@types/cookie": {
|
||||||
|
"version": "0.6.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.6.0.tgz",
|
||||||
|
"integrity": "sha512-4Kh9a6B2bQciAhf7FSuMRRkUWecJgJu9nPnx3yzpsfXX/c50REIqpHY4C82bXP90qrLtXtkDxTZosYO3UpOwlA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/@types/json5": {
|
"node_modules/@types/json5": {
|
||||||
"version": "0.0.29",
|
"version": "0.0.29",
|
||||||
"resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz",
|
"resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz",
|
||||||
@@ -2824,7 +2942,7 @@
|
|||||||
"version": "20.17.6",
|
"version": "20.17.6",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.6.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.17.6.tgz",
|
||||||
"integrity": "sha512-VEI7OdvK2wP7XHnsuXbAJnEpEkF6NjSN45QJlL4VGqZSXsnicpesdTWsg9RISeSdYd3yeRj/y3k5KGjUXYnFwQ==",
|
"integrity": "sha512-VEI7OdvK2wP7XHnsuXbAJnEpEkF6NjSN45QJlL4VGqZSXsnicpesdTWsg9RISeSdYd3yeRj/y3k5KGjUXYnFwQ==",
|
||||||
"devOptional": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"undici-types": "~6.19.2"
|
"undici-types": "~6.19.2"
|
||||||
}
|
}
|
||||||
@@ -2838,7 +2956,7 @@
|
|||||||
"version": "8.11.10",
|
"version": "8.11.10",
|
||||||
"resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.11.10.tgz",
|
"resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.11.10.tgz",
|
||||||
"integrity": "sha512-LczQUW4dbOQzsH2RQ5qoeJ6qJPdrcM/DcMLoqWQkMLMsq83J5lAX3LXjdkWdpscFy67JSOWDnh7Ny/sPFykmkg==",
|
"integrity": "sha512-LczQUW4dbOQzsH2RQ5qoeJ6qJPdrcM/DcMLoqWQkMLMsq83J5lAX3LXjdkWdpscFy67JSOWDnh7Ny/sPFykmkg==",
|
||||||
"devOptional": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/node": "*",
|
"@types/node": "*",
|
||||||
@@ -2850,7 +2968,7 @@
|
|||||||
"version": "4.0.2",
|
"version": "4.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/pg-types/-/pg-types-4.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/pg-types/-/pg-types-4.0.2.tgz",
|
||||||
"integrity": "sha512-cRL3JpS3lKMGsKaWndugWQoLOCoP+Cic8oseVcbr0qhPzYD5DWXK+RZ9LY9wxRf7RQia4SCwQlXk0q6FCPrVng==",
|
"integrity": "sha512-cRL3JpS3lKMGsKaWndugWQoLOCoP+Cic8oseVcbr0qhPzYD5DWXK+RZ9LY9wxRf7RQia4SCwQlXk0q6FCPrVng==",
|
||||||
"devOptional": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"pg-int8": "1.0.1",
|
"pg-int8": "1.0.1",
|
||||||
"pg-numeric": "1.0.2",
|
"pg-numeric": "1.0.2",
|
||||||
@@ -2868,7 +2986,7 @@
|
|||||||
"version": "3.0.2",
|
"version": "3.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-3.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-3.0.2.tgz",
|
||||||
"integrity": "sha512-6faShkdFugNQCLwucjPcY5ARoW1SlbnrZjmGl0IrrqewpvxvhSLHimCVzqeuULCbG0fQv7Dtk1yDbG3xv7Veog==",
|
"integrity": "sha512-6faShkdFugNQCLwucjPcY5ARoW1SlbnrZjmGl0IrrqewpvxvhSLHimCVzqeuULCbG0fQv7Dtk1yDbG3xv7Veog==",
|
||||||
"devOptional": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
}
|
}
|
||||||
@@ -2877,7 +2995,7 @@
|
|||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-3.0.0.tgz",
|
||||||
"integrity": "sha512-CNd4jim9RFPkObHSjVHlVrxoVQXz7quwNFpz7RY1okNNme49+sVyiTvTRobiLV548Hx/hb1BG+iE7h9493WzFw==",
|
"integrity": "sha512-CNd4jim9RFPkObHSjVHlVrxoVQXz7quwNFpz7RY1okNNme49+sVyiTvTRobiLV548Hx/hb1BG+iE7h9493WzFw==",
|
||||||
"devOptional": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"obuf": "~1.1.2"
|
"obuf": "~1.1.2"
|
||||||
},
|
},
|
||||||
@@ -2889,7 +3007,7 @@
|
|||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-2.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-2.1.0.tgz",
|
||||||
"integrity": "sha512-K7Juri8gtgXVcDfZttFKVmhglp7epKb1K4pgrkLxehjqkrgPhfG6OO8LHLkfaqkbpjNRnra018XwAr1yQFWGcA==",
|
"integrity": "sha512-K7Juri8gtgXVcDfZttFKVmhglp7epKb1K4pgrkLxehjqkrgPhfG6OO8LHLkfaqkbpjNRnra018XwAr1yQFWGcA==",
|
||||||
"devOptional": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
}
|
}
|
||||||
@@ -2898,7 +3016,7 @@
|
|||||||
"version": "3.0.0",
|
"version": "3.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-3.0.0.tgz",
|
||||||
"integrity": "sha512-BSNDnbyZCXSxgA+1f5UU2GmwhoI0aU5yMxRGO8CdFEcY2BQF9xm/7MqKnYoM1nJDk8nONNWDk9WeSmePFhQdlw==",
|
"integrity": "sha512-BSNDnbyZCXSxgA+1f5UU2GmwhoI0aU5yMxRGO8CdFEcY2BQF9xm/7MqKnYoM1nJDk8nONNWDk9WeSmePFhQdlw==",
|
||||||
"devOptional": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
}
|
}
|
||||||
@@ -2938,7 +3056,7 @@
|
|||||||
"version": "8.5.13",
|
"version": "8.5.13",
|
||||||
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.13.tgz",
|
"resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.13.tgz",
|
||||||
"integrity": "sha512-osM/gWBTPKgHV8XkTunnegTRIsvF6owmf5w+JtAfOw472dptdm0dlGv4xCt6GwQRcC2XVOvvRE/0bAoQcL2QkA==",
|
"integrity": "sha512-osM/gWBTPKgHV8XkTunnegTRIsvF6owmf5w+JtAfOw472dptdm0dlGv4xCt6GwQRcC2XVOvvRE/0bAoQcL2QkA==",
|
||||||
"devOptional": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/node": "*"
|
"@types/node": "*"
|
||||||
}
|
}
|
||||||
@@ -3604,7 +3722,7 @@
|
|||||||
"version": "1.1.34",
|
"version": "1.1.34",
|
||||||
"resolved": "https://registry.npmjs.org/bun-types/-/bun-types-1.1.34.tgz",
|
"resolved": "https://registry.npmjs.org/bun-types/-/bun-types-1.1.34.tgz",
|
||||||
"integrity": "sha512-br5QygTEL/TwB4uQOb96Ky22j4Gq2WxWH/8Oqv20fk5HagwKXo/akB+LiYgSfzexCt6kkcUaVm+bKiPl71xPvw==",
|
"integrity": "sha512-br5QygTEL/TwB4uQOb96Ky22j4Gq2WxWH/8Oqv20fk5HagwKXo/akB+LiYgSfzexCt6kkcUaVm+bKiPl71xPvw==",
|
||||||
"devOptional": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/node": "~20.12.8",
|
"@types/node": "~20.12.8",
|
||||||
"@types/ws": "~8.5.10"
|
"@types/ws": "~8.5.10"
|
||||||
@@ -3614,7 +3732,7 @@
|
|||||||
"version": "20.12.14",
|
"version": "20.12.14",
|
||||||
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.14.tgz",
|
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.12.14.tgz",
|
||||||
"integrity": "sha512-scnD59RpYD91xngrQQLGkE+6UrHUPzeKZWhhjBSa3HSkwjbQc38+q3RoIVEwxQGRw3M+j5hpNAM+lgV3cVormg==",
|
"integrity": "sha512-scnD59RpYD91xngrQQLGkE+6UrHUPzeKZWhhjBSa3HSkwjbQc38+q3RoIVEwxQGRw3M+j5hpNAM+lgV3cVormg==",
|
||||||
"devOptional": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"undici-types": "~5.26.4"
|
"undici-types": "~5.26.4"
|
||||||
}
|
}
|
||||||
@@ -3623,7 +3741,7 @@
|
|||||||
"version": "5.26.5",
|
"version": "5.26.5",
|
||||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",
|
||||||
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
|
"integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==",
|
||||||
"devOptional": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/busboy": {
|
"node_modules/busboy": {
|
||||||
"version": "1.6.0",
|
"version": "1.6.0",
|
||||||
@@ -3833,6 +3951,16 @@
|
|||||||
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz",
|
"resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz",
|
||||||
"integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A=="
|
"integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A=="
|
||||||
},
|
},
|
||||||
|
"node_modules/cookie": {
|
||||||
|
"version": "0.7.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.1.tgz",
|
||||||
|
"integrity": "sha512-6DnInpx7SJ2AK3+CTUE/ZM0vWTUboZCegxhC2xiIydHR9jNuTAASBrfEpHhiGOZw/nX51bHt6YQl8jsGo4y/0w==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 0.6"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/cosmiconfig": {
|
"node_modules/cosmiconfig": {
|
||||||
"version": "7.1.0",
|
"version": "7.1.0",
|
||||||
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.1.0.tgz",
|
||||||
@@ -4481,12 +4609,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/drizzle-orm": {
|
"node_modules/drizzle-orm": {
|
||||||
"version": "0.36.4",
|
"version": "0.38.2",
|
||||||
"resolved": "https://registry.npmjs.org/drizzle-orm/-/drizzle-orm-0.36.4.tgz",
|
"resolved": "https://registry.npmjs.org/drizzle-orm/-/drizzle-orm-0.38.2.tgz",
|
||||||
"integrity": "sha512-1OZY3PXD7BR00Gl61UUOFihslDldfH4NFRH2MbP54Yxi0G/PKn4HfO65JYZ7c16DeP3SpM3Aw+VXVG9j6CRSXA==",
|
"integrity": "sha512-eCE3yPRAskLo1WpM9OHpFaM70tBEDsWhwR/0M3CKyztAXKR9Qs3asZlcJOEliIcUSg8GuwrlY0dmYDgmm6y5GQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "Apache-2.0",
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@aws-sdk/client-rds-data": ">=3",
|
"@aws-sdk/client-rds-data": ">=3",
|
||||||
"@cloudflare/workers-types": ">=3",
|
"@cloudflare/workers-types": ">=4",
|
||||||
"@electric-sql/pglite": ">=0.2.0",
|
"@electric-sql/pglite": ">=0.2.0",
|
||||||
"@libsql/client": ">=0.10.0",
|
"@libsql/client": ">=0.10.0",
|
||||||
"@libsql/client-wasm": ">=0.10.0",
|
"@libsql/client-wasm": ">=0.10.0",
|
||||||
@@ -6293,6 +6423,16 @@
|
|||||||
"jiti": "bin/jiti.js"
|
"jiti": "bin/jiti.js"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/jose": {
|
||||||
|
"version": "5.9.6",
|
||||||
|
"resolved": "https://registry.npmjs.org/jose/-/jose-5.9.6.tgz",
|
||||||
|
"integrity": "sha512-AMlnetc9+CV9asI19zHmrgS/WYsWUwCn2R7RzlbJWD7F9eWYUTGyBmU9o6PxngtLGOiDGPRu+Uc4fhKzbpteZQ==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/panva"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/js-tokens": {
|
"node_modules/js-tokens": {
|
||||||
"version": "4.0.0",
|
"version": "4.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
|
||||||
@@ -6692,6 +6832,34 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/next-auth": {
|
||||||
|
"version": "5.0.0-beta.25",
|
||||||
|
"resolved": "https://registry.npmjs.org/next-auth/-/next-auth-5.0.0-beta.25.tgz",
|
||||||
|
"integrity": "sha512-2dJJw1sHQl2qxCrRk+KTQbeH+izFbGFPuJj5eGgBZFYyiYYtvlrBeUw1E/OJJxTRjuxbSYGnCTkUIRsIIW0bog==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "ISC",
|
||||||
|
"dependencies": {
|
||||||
|
"@auth/core": "0.37.2"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@simplewebauthn/browser": "^9.0.1",
|
||||||
|
"@simplewebauthn/server": "^9.0.2",
|
||||||
|
"next": "^14.0.0-0 || ^15.0.0-0",
|
||||||
|
"nodemailer": "^6.6.5",
|
||||||
|
"react": "^18.2.0 || ^19.0.0-0"
|
||||||
|
},
|
||||||
|
"peerDependenciesMeta": {
|
||||||
|
"@simplewebauthn/browser": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"@simplewebauthn/server": {
|
||||||
|
"optional": true
|
||||||
|
},
|
||||||
|
"nodemailer": {
|
||||||
|
"optional": true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/next-themes": {
|
"node_modules/next-themes": {
|
||||||
"version": "0.4.3",
|
"version": "0.4.3",
|
||||||
"resolved": "https://registry.npmjs.org/next-themes/-/next-themes-0.4.3.tgz",
|
"resolved": "https://registry.npmjs.org/next-themes/-/next-themes-0.4.3.tgz",
|
||||||
@@ -6752,6 +6920,16 @@
|
|||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/oauth4webapi": {
|
||||||
|
"version": "3.1.4",
|
||||||
|
"resolved": "https://registry.npmjs.org/oauth4webapi/-/oauth4webapi-3.1.4.tgz",
|
||||||
|
"integrity": "sha512-eVfN3nZNbok2s/ROifO0UAc5G8nRoLSbrcKJ09OqmucgnhXEfdIQOR4gq1eJH1rN3gV7rNw62bDEgftsgFtBEg==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"funding": {
|
||||||
|
"url": "https://github.com/sponsors/panva"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/object-assign": {
|
"node_modules/object-assign": {
|
||||||
"version": "4.1.1",
|
"version": "4.1.1",
|
||||||
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
|
||||||
@@ -6874,7 +7052,7 @@
|
|||||||
"version": "1.1.2",
|
"version": "1.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz",
|
"resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz",
|
||||||
"integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==",
|
"integrity": "sha512-PX1wu0AmAdPqOL1mWhqmlOd8kOIZQwGZw6rh7uby9fTc5lhaOWFLX3I6R1hrF9k3zUY40e6igsLGkDXK92LJNg==",
|
||||||
"devOptional": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/once": {
|
"node_modules/once": {
|
||||||
"version": "1.4.0",
|
"version": "1.4.0",
|
||||||
@@ -7068,7 +7246,7 @@
|
|||||||
"version": "1.0.2",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/pg-numeric/-/pg-numeric-1.0.2.tgz",
|
"resolved": "https://registry.npmjs.org/pg-numeric/-/pg-numeric-1.0.2.tgz",
|
||||||
"integrity": "sha512-BM/Thnrw5jm2kKLE5uJkXqqExRUY/toLHda65XgFTBTFYZyopbKjBe29Ii3RbkvlsMoFwD+tHeGaCjjv0gHlyw==",
|
"integrity": "sha512-BM/Thnrw5jm2kKLE5uJkXqqExRUY/toLHda65XgFTBTFYZyopbKjBe29Ii3RbkvlsMoFwD+tHeGaCjjv0gHlyw==",
|
||||||
"devOptional": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=4"
|
"node": ">=4"
|
||||||
}
|
}
|
||||||
@@ -7336,7 +7514,31 @@
|
|||||||
"version": "1.1.4",
|
"version": "1.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/postgres-range/-/postgres-range-1.1.4.tgz",
|
"resolved": "https://registry.npmjs.org/postgres-range/-/postgres-range-1.1.4.tgz",
|
||||||
"integrity": "sha512-i/hbxIE9803Alj/6ytL7UHQxRvZkI9O4Sy+J3HGc4F4oo/2eQAjTSNJ0bfxyse3bH0nuVesCk+3IRLaMtG3H6w==",
|
"integrity": "sha512-i/hbxIE9803Alj/6ytL7UHQxRvZkI9O4Sy+J3HGc4F4oo/2eQAjTSNJ0bfxyse3bH0nuVesCk+3IRLaMtG3H6w==",
|
||||||
"devOptional": true
|
"dev": true
|
||||||
|
},
|
||||||
|
"node_modules/preact": {
|
||||||
|
"version": "10.24.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/preact/-/preact-10.24.3.tgz",
|
||||||
|
"integrity": "sha512-Z2dPnBnMUfyQfSQ+GBdsGa16hz35YmLmtTLhM169uW944hYL6xzTYkJjC07j+Wosz733pMWx0fgON3JNw1jJQA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"funding": {
|
||||||
|
"type": "opencollective",
|
||||||
|
"url": "https://opencollective.com/preact"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/preact-render-to-string": {
|
||||||
|
"version": "5.2.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/preact-render-to-string/-/preact-render-to-string-5.2.3.tgz",
|
||||||
|
"integrity": "sha512-aPDxUn5o3GhWdtJtW0svRC2SS/l8D9MAgo2+AWml+BhDImb27ALf04Q2d+AHqUUOc6RdSXFIBVa2gxzgMKgtZA==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"pretty-format": "^3.8.0"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"preact": ">=10"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"node_modules/prelude-ls": {
|
"node_modules/prelude-ls": {
|
||||||
"version": "1.2.1",
|
"version": "1.2.1",
|
||||||
@@ -7347,10 +7549,18 @@
|
|||||||
"node": ">= 0.8.0"
|
"node": ">= 0.8.0"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/pretty-format": {
|
||||||
|
"version": "3.8.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-3.8.0.tgz",
|
||||||
|
"integrity": "sha512-WuxUnVtlWL1OfZFQFuqvnvs6MiAGk9UNsBostyBOB0Is9wb5uRESevA6rnl/rkksXaGX3GzZhPup5d6Vp1nFew==",
|
||||||
|
"dev": true,
|
||||||
|
"license": "MIT"
|
||||||
|
},
|
||||||
"node_modules/prisma": {
|
"node_modules/prisma": {
|
||||||
"version": "5.22.0",
|
"version": "5.22.0",
|
||||||
"resolved": "https://registry.npmjs.org/prisma/-/prisma-5.22.0.tgz",
|
"resolved": "https://registry.npmjs.org/prisma/-/prisma-5.22.0.tgz",
|
||||||
"integrity": "sha512-vtpjW3XuYCSnMsNVBjLMNkTj6OZbudcPPTPYHqX0CJfpcdWciI1dM8uHETwmDxxiqEwCIE6WvXucWUetJgfu/A==",
|
"integrity": "sha512-vtpjW3XuYCSnMsNVBjLMNkTj6OZbudcPPTPYHqX0CJfpcdWciI1dM8uHETwmDxxiqEwCIE6WvXucWUetJgfu/A==",
|
||||||
|
"dev": true,
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"optional": true,
|
"optional": true,
|
||||||
"peer": true,
|
"peer": true,
|
||||||
@@ -8473,7 +8683,7 @@
|
|||||||
"version": "6.19.8",
|
"version": "6.19.8",
|
||||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz",
|
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz",
|
||||||
"integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==",
|
"integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==",
|
||||||
"devOptional": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/update-browserslist-db": {
|
"node_modules/update-browserslist-db": {
|
||||||
"version": "1.1.1",
|
"version": "1.1.1",
|
||||||
|
|||||||
@@ -25,7 +25,6 @@
|
|||||||
"class-variance-authority": "^0.7.0",
|
"class-variance-authority": "^0.7.0",
|
||||||
"clsx": "^2.1.1",
|
"clsx": "^2.1.1",
|
||||||
"dotenv": "^16.4.7",
|
"dotenv": "^16.4.7",
|
||||||
"drizzle-orm": "^0.36.4",
|
|
||||||
"fontsource-roboto": "^4.0.0",
|
"fontsource-roboto": "^4.0.0",
|
||||||
"framer-motion": "^11.11.17",
|
"framer-motion": "^11.11.17",
|
||||||
"lucide-react": "^0.460.0",
|
"lucide-react": "^0.460.0",
|
||||||
@@ -39,6 +38,7 @@
|
|||||||
"tailwindcss-animate": "^1.0.7"
|
"tailwindcss-animate": "^1.0.7"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@auth/drizzle-adapter": "^1.7.4",
|
||||||
"@types/bun": "^1.1.13",
|
"@types/bun": "^1.1.13",
|
||||||
"@types/node": "^20.17.6",
|
"@types/node": "^20.17.6",
|
||||||
"@types/pg": "^8.11.10",
|
"@types/pg": "^8.11.10",
|
||||||
@@ -46,8 +46,10 @@
|
|||||||
"@types/react-dom": "^18",
|
"@types/react-dom": "^18",
|
||||||
"autoprefixer": "^10.4.20",
|
"autoprefixer": "^10.4.20",
|
||||||
"drizzle-kit": "^0.28.1",
|
"drizzle-kit": "^0.28.1",
|
||||||
|
"drizzle-orm": "^0.38.2",
|
||||||
"eslint": "^8",
|
"eslint": "^8",
|
||||||
"eslint-config-next": "15.0.3",
|
"eslint-config-next": "15.0.3",
|
||||||
|
"next-auth": "^5.0.0-beta.25",
|
||||||
"postcss": "^8",
|
"postcss": "^8",
|
||||||
"tailwindcss": "^3.4.15",
|
"tailwindcss": "^3.4.15",
|
||||||
"tsx": "^4.19.2",
|
"tsx": "^4.19.2",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { pgTable, integer, varchar } from "drizzle-orm/pg-core";
|
import { pgTable, integer, varchar } from "drizzle-orm/pg-core";
|
||||||
import { sql } from "drizzle-orm";
|
import { sql } from "drizzle-orm";
|
||||||
import { timestamps } from "../../db/schema/helpers/columns.helpers";
|
import { timestamps } from "../../drizzle/schema/helpers/columns.helpers";
|
||||||
|
|
||||||
export const accounts = pgTable("base_table", {
|
export const accounts = pgTable("base_table", {
|
||||||
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "base_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "base_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||||
|
|||||||
16
src/app/auth.ts
Normal file
16
src/app/auth.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import NextAuth from "next-auth"
|
||||||
|
import Google from "next-auth/providers/google"
|
||||||
|
import { DrizzleAdapter } from "@auth/drizzle-adapter"
|
||||||
|
import { db } from "../db";
|
||||||
|
import { users, account, session, verificationToken } from "@schemas/schema";
|
||||||
|
|
||||||
|
|
||||||
|
export const { handlers, auth } = NextAuth({
|
||||||
|
adapter: DrizzleAdapter(db, {
|
||||||
|
usersTable: users,
|
||||||
|
accountsTable: account,
|
||||||
|
sessionsTable: session,
|
||||||
|
verificationTokensTable: verificationToken,
|
||||||
|
}),
|
||||||
|
providers: []
|
||||||
|
})
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
'use client';
|
'use client';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
import { useRouter } from 'next/navigation';
|
import { useRouter } from 'next/navigation';
|
||||||
import constants from '@src/lib/constants';
|
import constants from '@lib/constants';
|
||||||
import Link from 'next/link';
|
import Link from 'next/link';
|
||||||
|
|
||||||
export default function SignInPage() {
|
export default function SignInPage() {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { db } from '../../index';
|
import { db } from '../../index';
|
||||||
import { psa } from '@schemas/Psa';
|
import { psa } from '@schemas/schema';
|
||||||
import { eq, lt, gte, ne, and, like } from 'drizzle-orm';
|
import { eq, lt, gte, ne, and, like } from 'drizzle-orm';
|
||||||
import CATEGORY from '@src/data/parts_cats.json';
|
import CATEGORY from '@src/data/parts_cats.json';
|
||||||
|
|
||||||
|
|||||||
26
src/db/schema/Accounts.ts
Normal file
26
src/db/schema/Accounts.ts
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
import { users } from "@schemas/schema";
|
||||||
|
import { integer, pgTable, primaryKey, text } from "drizzle-orm/pg-core";
|
||||||
|
import type { AdapterAccountType } from "next-auth/adapters"
|
||||||
|
export const accounts = pgTable(
|
||||||
|
"account",
|
||||||
|
{
|
||||||
|
userId: text("userId")
|
||||||
|
.notNull()
|
||||||
|
.references(() => users.id, { onDelete: "cascade" }),
|
||||||
|
type: text("type").$type<AdapterAccountType>().notNull(),
|
||||||
|
provider: text("provider").notNull(),
|
||||||
|
providerAccountId: text("providerAccountId").notNull(),
|
||||||
|
refresh_token: text("refresh_token"),
|
||||||
|
access_token: text("access_token"),
|
||||||
|
expires_at: integer("expires_at"),
|
||||||
|
token_type: text("token_type"),
|
||||||
|
scope: text("scope"),
|
||||||
|
id_token: text("id_token"),
|
||||||
|
session_state: text("session_state"),
|
||||||
|
},
|
||||||
|
(account) => ({
|
||||||
|
compoundKey: primaryKey({
|
||||||
|
columns: [account.provider, account.providerAccountId],
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
)
|
||||||
29
src/db/schema/AeroPrecision.ts
Normal file
29
src/db/schema/AeroPrecision.ts
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
import { numeric, pgTable, text, uuid } from "drizzle-orm/pg-core";
|
||||||
|
|
||||||
|
export const aeroPrecision = pgTable("aero_precision", {
|
||||||
|
sku: text().primaryKey().notNull(),
|
||||||
|
manufacturerId: text("manufacturer_id"),
|
||||||
|
brandName: text("brand_name"),
|
||||||
|
productName: text("product_name"),
|
||||||
|
longDescription: text("long_description"),
|
||||||
|
shortDescription: text("short_description"),
|
||||||
|
department: text(),
|
||||||
|
category: text(),
|
||||||
|
subcategory: text(),
|
||||||
|
thumbUrl: text("thumb_url"),
|
||||||
|
imageUrl: text("image_url"),
|
||||||
|
buyLink: text("buy_link"),
|
||||||
|
keywords: text(),
|
||||||
|
reviews: text(),
|
||||||
|
retailPrice: numeric("retail_price"),
|
||||||
|
salePrice: numeric("sale_price"),
|
||||||
|
brandPageLink: text("brand_page_link"),
|
||||||
|
brandLogoImage: text("brand_logo_image"),
|
||||||
|
productPageViewTracking: text("product_page_view_tracking"),
|
||||||
|
variantsXml: text("variants_xml"),
|
||||||
|
mediumImageUrl: text("medium_image_url"),
|
||||||
|
productContentWidget: text("product_content_widget"),
|
||||||
|
googleCategorization: text("google_categorization"),
|
||||||
|
itemBasedCommission: text("item_based_commission"),
|
||||||
|
uuid: uuid().defaultRandom(),
|
||||||
|
});
|
||||||
22
src/db/schema/Authenticators.ts
Normal file
22
src/db/schema/Authenticators.ts
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
import { boolean, integer, pgTable, primaryKey, text } from "drizzle-orm/pg-core";
|
||||||
|
import { users } from '@schemas/schema'
|
||||||
|
export const authenticators = pgTable(
|
||||||
|
"authenticator",
|
||||||
|
{
|
||||||
|
credentialID: text("credentialID").notNull().unique(),
|
||||||
|
userId: text("userId")
|
||||||
|
.notNull()
|
||||||
|
.references(() => users.id, { onDelete: "cascade" }),
|
||||||
|
providerAccountId: text("providerAccountId").notNull(),
|
||||||
|
credentialPublicKey: text("credentialPublicKey").notNull(),
|
||||||
|
counter: integer("counter").notNull(),
|
||||||
|
credentialDeviceType: text("credentialDeviceType").notNull(),
|
||||||
|
credentialBackedUp: boolean("credentialBackedUp").notNull(),
|
||||||
|
transports: text("transports"),
|
||||||
|
},
|
||||||
|
(authenticator) => ({
|
||||||
|
compositePK: primaryKey({
|
||||||
|
columns: [authenticator.userId, authenticator.credentialID],
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
)
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { pgTable, integer, varchar, uuid } from "drizzle-orm/pg-core";
|
import { pgTable, integer, varchar, uuid } from "drizzle-orm/pg-core";
|
||||||
import { sql } from "drizzle-orm";
|
import { sql } from "drizzle-orm";
|
||||||
import { timestamps } from "./helpers/columns.helpers";
|
import { timestamps } from "../../drizzle/schema/helpers/columns.helpers";
|
||||||
|
|
||||||
export const brand = pgTable("brands", {
|
export const brand = pgTable("brands", {
|
||||||
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "brands_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "brands_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { pgTable, integer, varchar, text, uuid } from "drizzle-orm/pg-core";
|
import { pgTable, integer, varchar, text, uuid } from "drizzle-orm/pg-core";
|
||||||
import { sql } from "drizzle-orm";
|
import { sql } from "drizzle-orm";
|
||||||
import { timestamps } from "./helpers/columns.helpers";
|
import { timestamps } from "../../drizzle/schema/helpers/columns.helpers";
|
||||||
|
|
||||||
export const Build = pgTable("builds", {
|
export const Build = pgTable("builds", {
|
||||||
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "build_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "build_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { pgTable, integer, varchar, text, uuid } from "drizzle-orm/pg-core";
|
import { pgTable, integer, varchar, text, uuid } from "drizzle-orm/pg-core";
|
||||||
import { sql } from "drizzle-orm";
|
import { sql } from "drizzle-orm";
|
||||||
import { timestamps } from "./helpers/columns.helpers";
|
import { timestamps } from "../../drizzle/schema/helpers/columns.helpers";
|
||||||
|
|
||||||
export const BuildComponent = pgTable("builds_components", {
|
export const BuildComponent = pgTable("builds_components", {
|
||||||
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "build_components_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "build_components_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { pgTable, integer, varchar, uuid } from "drizzle-orm/pg-core";
|
import { pgTable, integer, varchar, uuid } from "drizzle-orm/pg-core";
|
||||||
import { sql } from "drizzle-orm";
|
import { sql } from "drizzle-orm";
|
||||||
import { timestamps } from "./helpers/columns.helpers";
|
import { timestamps } from "../../drizzle/schema/helpers/columns.helpers";
|
||||||
|
|
||||||
export const Category = pgTable("categories", {
|
export const Category = pgTable("categories", {
|
||||||
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "categories_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "categories_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { pgTable, integer, varchar, text,uuid} from "drizzle-orm/pg-core";
|
import { pgTable, integer, varchar, text,uuid} from "drizzle-orm/pg-core";
|
||||||
import { sql } from "drizzle-orm";
|
import { sql } from "drizzle-orm";
|
||||||
import { timestamps } from "./helpers/columns.helpers";
|
import { timestamps } from "../../drizzle/schema/helpers/columns.helpers";
|
||||||
|
|
||||||
export const compartment = pgTable("compartment", {
|
export const compartment = pgTable("compartment", {
|
||||||
id: uuid().defaultRandom().primaryKey().notNull(),
|
id: uuid().defaultRandom().primaryKey().notNull(),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { pgTable, integer, varchar, uuid} from "drizzle-orm/pg-core";
|
import { pgTable, integer, varchar, uuid} from "drizzle-orm/pg-core";
|
||||||
import { sql } from "drizzle-orm";
|
import { sql } from "drizzle-orm";
|
||||||
import { timestamps } from "./helpers/columns.helpers";
|
import { timestamps } from "../../drizzle/schema/helpers/columns.helpers";
|
||||||
|
|
||||||
export const ComponentType = pgTable("component_type", {
|
export const ComponentType = pgTable("component_type", {
|
||||||
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "component_type_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "component_type_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { pgTable, integer, varchar, text, doublePrecision, timestamp } from "drizzle-orm/pg-core"
|
import { pgTable, integer, varchar, text, doublePrecision, timestamp } from "drizzle-orm/pg-core"
|
||||||
import { sql } from "drizzle-orm"
|
import { sql } from "drizzle-orm"
|
||||||
import { timestamps } from "./helpers/columns.helpers";
|
import { timestamps } from "../../drizzle/schema/helpers/columns.helpers";
|
||||||
|
|
||||||
|
|
||||||
export const LipseyCatalog = pgTable("lipseycatalog", {
|
export const LipseyCatalog = pgTable("lipseycatalog", {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { pgTable, integer, varchar, uuid} from "drizzle-orm/pg-core";
|
import { pgTable, integer, varchar, uuid} from "drizzle-orm/pg-core";
|
||||||
import { sql } from "drizzle-orm";
|
import { sql } from "drizzle-orm";
|
||||||
import { timestamps } from "./helpers/columns.helpers";
|
import { timestamps } from "../../drizzle/schema/helpers/columns.helpers";
|
||||||
|
|
||||||
export const manufacturer = pgTable("manufacturer", {
|
export const manufacturer = pgTable("manufacturer", {
|
||||||
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "manufacturer_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "manufacturer_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { pgTable, integer, varchar, text, decimal } from "drizzle-orm/pg-core";
|
import { pgTable, integer, varchar, text, decimal } from "drizzle-orm/pg-core";
|
||||||
import { sql } from "drizzle-orm";
|
import { sql } from "drizzle-orm";
|
||||||
import { timestamps } from "./helpers/columns.helpers";
|
import { timestamps } from "../../drizzle/schema/helpers/columns.helpers";
|
||||||
|
|
||||||
export const Product = pgTable("products", {
|
export const Product = pgTable("products", {
|
||||||
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "products_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "products_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { pgTable, integer, varchar, timestamp, uuid } from "drizzle-orm/pg-core";
|
import { pgTable, integer, varchar, timestamp, uuid } from "drizzle-orm/pg-core";
|
||||||
import { sql } from "drizzle-orm";
|
import { sql } from "drizzle-orm";
|
||||||
import { timestamps } from "./helpers/columns.helpers";
|
import { timestamps } from "../../drizzle/schema/helpers/columns.helpers";
|
||||||
|
|
||||||
export const Product_feed = pgTable("product_feeds", {
|
export const Product_feed = pgTable("product_feeds", {
|
||||||
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "productfeeds_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "productfeeds_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
import { pgTable, integer, varchar, text, decimal, uuid, real } from "drizzle-orm/pg-core";
|
import { pgTable, integer, varchar, text, decimal, uuid, real } from "drizzle-orm/pg-core";
|
||||||
import { sql } from "drizzle-orm";
|
import { sql } from "drizzle-orm";
|
||||||
import { timestamps } from "./helpers/columns.helpers";
|
import { timestamps } from "../../drizzle/schema/helpers/columns.helpers";
|
||||||
|
|
||||||
export const psa = pgTable("psa", {
|
export const psa = pgTable("psa", {
|
||||||
sku: varchar("SKU", { length: 50 }),
|
sku: varchar("SKU", { length: 50 }),
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { pgTable, integer, varchar, uuid } from "drizzle-orm/pg-core";
|
import { pgTable, integer, varchar, uuid } from "drizzle-orm/pg-core";
|
||||||
import { sql } from "drizzle-orm";
|
import { sql } from "drizzle-orm";
|
||||||
import { timestamps } from "./helpers/columns.helpers";
|
import { timestamps } from "../../drizzle/schema/helpers/columns.helpers";
|
||||||
|
|
||||||
export const Reseller = pgTable("bal_resellers", {
|
export const Reseller = pgTable("bal_resellers", {
|
||||||
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "resellers_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "resellers_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||||
|
|||||||
10
src/db/schema/Sessions.ts
Normal file
10
src/db/schema/Sessions.ts
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import { pgTable, text, timestamp } from "drizzle-orm/pg-core";
|
||||||
|
import {user} from '@schemas/schema';
|
||||||
|
export const sessions = pgTable("session", {
|
||||||
|
sessionToken: text("sessionToken").primaryKey(),
|
||||||
|
userId: text("userId")
|
||||||
|
.notNull()
|
||||||
|
.references(() => user.id, { onDelete: "cascade" }),
|
||||||
|
expires: timestamp("expires", { mode: "date" }).notNull(),
|
||||||
|
})
|
||||||
|
|
||||||
@@ -25,3 +25,13 @@ export const User = pgTable("users", {
|
|||||||
usersBuildPrivacySettingCheck: check("users_build_privacy_setting_check", sql`build_privacy_setting = ANY (ARRAY['private'::text, 'public'::text])`),
|
usersBuildPrivacySettingCheck: check("users_build_privacy_setting_check", sql`build_privacy_setting = ANY (ARRAY['private'::text, 'public'::text])`),
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const users = pgTable("user", {
|
||||||
|
id: text("id")
|
||||||
|
.primaryKey()
|
||||||
|
.$defaultFn(() => crypto.randomUUID()),
|
||||||
|
name: text("name"),
|
||||||
|
email: text("email").unique(),
|
||||||
|
emailVerified: timestamp("emailVerified", { mode: "date" }),
|
||||||
|
image: text("image"),
|
||||||
|
})
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
import { bigint, bigserial, foreignKey, pgTable, text, timestamp } from "drizzle-orm/pg-core";
|
import { bigint, bigserial, foreignKey, pgTable, text, timestamp } from "drizzle-orm/pg-core";
|
||||||
|
import { sql } from "drizzle-orm";
|
||||||
import { users } from "./User";
|
import { users } from "./User";
|
||||||
|
|
||||||
export const userActivityLog = pgTable("user_activity_log", {
|
export const userActivityLog = pgTable("user_activity_log", {
|
||||||
id: bigserial({ mode: "bigint" }).primaryKey().notNull(),
|
id: bigint({ mode: "bigint" }).primaryKey().generatedAlwaysAsIdentity({ name: "user_activity_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }).notNull(),
|
||||||
// You can use { mode: "bigint" } if numbers are exceeding js number limitations
|
// You can use { mode: "bigint" } if numbers are exceeding js number limitations
|
||||||
userId: bigint("user_id", { mode: "number" }).notNull(),
|
userId: bigint("user_id", { mode: "number" }).notNull(),
|
||||||
activity: text().notNull(),
|
activity: text().notNull(),
|
||||||
|
|||||||
16
src/db/schema/VerificationTokens.ts
Normal file
16
src/db/schema/VerificationTokens.ts
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
import { pgTable, primaryKey, text, timestamp } from "drizzle-orm/pg-core";
|
||||||
|
|
||||||
|
export const verificationTokens = pgTable(
|
||||||
|
"verificationToken",
|
||||||
|
{
|
||||||
|
identifier: text("identifier").notNull(),
|
||||||
|
token: text("token").notNull(),
|
||||||
|
expires: timestamp("expires", { mode: "date" }).notNull(),
|
||||||
|
},
|
||||||
|
(verificationToken) => ({
|
||||||
|
compositePk: primaryKey({
|
||||||
|
columns: [verificationToken.identifier, verificationToken.token],
|
||||||
|
}),
|
||||||
|
})
|
||||||
|
)
|
||||||
|
|
||||||
@@ -1,29 +1,13 @@
|
|||||||
import { relations } from "drizzle-orm/relations";
|
import { relations } from "drizzle-orm/relations";
|
||||||
import { users, userBuilds, userFavorites, userActivityLog } from "./schema";
|
import { user, authenticator } from "./schema";
|
||||||
|
|
||||||
export const userBuildsRelations = relations(userBuilds, ({one}) => ({
|
export const authenticatorRelations = relations(authenticator, ({one}) => ({
|
||||||
user: one(users, {
|
user: one(user, {
|
||||||
fields: [userBuilds.userId],
|
fields: [authenticator.userId],
|
||||||
references: [users.id]
|
references: [user.id]
|
||||||
}),
|
}),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
export const usersRelations = relations(users, ({many}) => ({
|
export const userRelations = relations(user, ({many}) => ({
|
||||||
userBuilds: many(userBuilds),
|
authenticators: many(authenticator),
|
||||||
userFavorites: many(userFavorites),
|
|
||||||
userActivityLogs: many(userActivityLog),
|
|
||||||
}));
|
|
||||||
|
|
||||||
export const userFavoritesRelations = relations(userFavorites, ({one}) => ({
|
|
||||||
user: one(users, {
|
|
||||||
fields: [userFavorites.userId],
|
|
||||||
references: [users.id]
|
|
||||||
}),
|
|
||||||
}));
|
|
||||||
|
|
||||||
export const userActivityLogRelations = relations(userActivityLog, ({one}) => ({
|
|
||||||
user: one(users, {
|
|
||||||
fields: [userActivityLog.userId],
|
|
||||||
references: [users.id]
|
|
||||||
}),
|
|
||||||
}));
|
}));
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { pgTable, integer, varchar, text, numeric, timestamp, uuid, unique, foreignKey, bigserial, bigint, boolean, index, real, check, date, doublePrecision, pgView } from "drizzle-orm/pg-core"
|
import { pgTable, integer, varchar, text, numeric, timestamp, unique, check, bigserial, date, boolean, uuid, bigint, real, doublePrecision, primaryKey, foreignKey } from "drizzle-orm/pg-core"
|
||||||
import { sql } from "drizzle-orm"
|
import { sql } from "drizzle-orm"
|
||||||
|
|
||||||
|
|
||||||
@@ -16,6 +16,31 @@ export const products = pgTable("products", {
|
|||||||
deletedAt: timestamp("deleted_at", { mode: 'string' }),
|
deletedAt: timestamp("deleted_at", { mode: 'string' }),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
export const users = pgTable("users", {
|
||||||
|
id: bigserial({ mode: "bigint" }).primaryKey().notNull(),
|
||||||
|
username: varchar({ length: 50 }).notNull(),
|
||||||
|
email: varchar({ length: 255 }).notNull(),
|
||||||
|
passwordHash: varchar("password_hash", { length: 255 }).notNull(),
|
||||||
|
firstName: varchar("first_name", { length: 50 }),
|
||||||
|
lastName: varchar("last_name", { length: 50 }),
|
||||||
|
profilePicture: varchar("profile_picture", { length: 255 }),
|
||||||
|
dateOfBirth: date("date_of_birth"),
|
||||||
|
phoneNumber: varchar("phone_number", { length: 20 }),
|
||||||
|
createdAt: timestamp("created_at", { mode: 'string' }).default(sql`CURRENT_TIMESTAMP`),
|
||||||
|
updatedAt: timestamp("updated_at", { mode: 'string' }).default(sql`CURRENT_TIMESTAMP`),
|
||||||
|
isAdmin: boolean("is_admin").default(false),
|
||||||
|
lastLogin: timestamp("last_login", { mode: 'string' }),
|
||||||
|
emailVerified: boolean("email_verified").default(false),
|
||||||
|
buildPrivacySetting: text("build_privacy_setting").default('public'),
|
||||||
|
uuid: uuid().defaultRandom(),
|
||||||
|
}, (table) => {
|
||||||
|
return {
|
||||||
|
usersUsernameKey: unique("users_username_key").on(table.username),
|
||||||
|
usersEmailKey: unique("users_email_key").on(table.email),
|
||||||
|
usersBuildPrivacySettingCheck: check("users_build_privacy_setting_check", sql`build_privacy_setting = ANY (ARRAY['private'::text, 'public'::text])`),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
export const categories = pgTable("categories", {
|
export const categories = pgTable("categories", {
|
||||||
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "categories_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "categories_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||||
name: varchar({ length: 100 }).notNull(),
|
name: varchar({ length: 100 }).notNull(),
|
||||||
@@ -41,40 +66,25 @@ export const productFeeds = pgTable("product_feeds", {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export const userBuilds = pgTable("user_builds", {
|
export const user = pgTable("user", {
|
||||||
id: bigserial({ mode: "bigint" }).primaryKey().notNull(),
|
id: text().primaryKey().notNull(),
|
||||||
// You can use { mode: "bigint" } if numbers are exceeding js number limitations
|
name: text(),
|
||||||
userId: bigint("user_id", { mode: "number" }).notNull(),
|
email: text(),
|
||||||
buildName: varchar("build_name", { length: 255 }).notNull(),
|
emailVerified: timestamp({ mode: 'string' }),
|
||||||
buildDescription: text("build_description"),
|
image: text(),
|
||||||
createdAt: timestamp("created_at", { mode: 'string' }).default(sql`CURRENT_TIMESTAMP`),
|
|
||||||
updatedAt: timestamp("updated_at", { mode: 'string' }).default(sql`CURRENT_TIMESTAMP`),
|
|
||||||
isShared: boolean("is_shared").default(false),
|
|
||||||
}, (table) => {
|
}, (table) => {
|
||||||
return {
|
return {
|
||||||
userBuildsUserIdFkey: foreignKey({
|
userEmailUnique: unique("user_email_unique").on(table.email),
|
||||||
columns: [table.userId],
|
|
||||||
foreignColumns: [users.id],
|
|
||||||
name: "user_builds_user_id_fkey"
|
|
||||||
}).onDelete("cascade"),
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export const userFavorites = pgTable("user_favorites", {
|
export const userActivityLog = pgTable("user_activity_log", {
|
||||||
id: bigserial({ mode: "bigint" }).primaryKey().notNull(),
|
// You can use { mode: "bigint" } if numbers are exceeding js number limitations
|
||||||
|
id: bigint({ mode: "number" }).primaryKey().generatedAlwaysAsIdentity({ name: "user_activity_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||||
// You can use { mode: "bigint" } if numbers are exceeding js number limitations
|
// You can use { mode: "bigint" } if numbers are exceeding js number limitations
|
||||||
userId: bigint("user_id", { mode: "number" }).notNull(),
|
userId: bigint("user_id", { mode: "number" }).notNull(),
|
||||||
// You can use { mode: "bigint" } if numbers are exceeding js number limitations
|
activity: text().notNull(),
|
||||||
itemId: bigint("item_id", { mode: "number" }).notNull(),
|
timestamp: timestamp({ mode: 'string' }).default(sql`CURRENT_TIMESTAMP`),
|
||||||
addedAt: timestamp("added_at", { mode: 'string' }).default(sql`CURRENT_TIMESTAMP`),
|
|
||||||
}, (table) => {
|
|
||||||
return {
|
|
||||||
userFavoritesUserIdFkey: foreignKey({
|
|
||||||
columns: [table.userId],
|
|
||||||
foreignColumns: [users.id],
|
|
||||||
name: "user_favorites_user_id_fkey"
|
|
||||||
}).onDelete("cascade"),
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export const brands = pgTable("brands", {
|
export const brands = pgTable("brands", {
|
||||||
@@ -103,20 +113,10 @@ export const manufacturer = pgTable("manufacturer", {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export const userActivityLog = pgTable("user_activity_log", {
|
export const session = pgTable("session", {
|
||||||
id: bigserial({ mode: "bigint" }).primaryKey().notNull(),
|
sessionToken: text().primaryKey().notNull(),
|
||||||
// You can use { mode: "bigint" } if numbers are exceeding js number limitations
|
userId: text().notNull(),
|
||||||
userId: bigint("user_id", { mode: "number" }).notNull(),
|
expires: timestamp({ mode: 'string' }).notNull(),
|
||||||
activity: text().notNull(),
|
|
||||||
timestamp: timestamp({ mode: 'string' }).default(sql`CURRENT_TIMESTAMP`),
|
|
||||||
}, (table) => {
|
|
||||||
return {
|
|
||||||
userActivityLogUserIdFkey: foreignKey({
|
|
||||||
columns: [table.userId],
|
|
||||||
foreignColumns: [users.id],
|
|
||||||
name: "user_activity_log_user_id_fkey"
|
|
||||||
}).onDelete("cascade"),
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export const states = pgTable("states", {
|
export const states = pgTable("states", {
|
||||||
@@ -186,72 +186,10 @@ export const builds = pgTable("builds", {
|
|||||||
uuid: uuid().defaultRandom(),
|
uuid: uuid().defaultRandom(),
|
||||||
}, (table) => {
|
}, (table) => {
|
||||||
return {
|
return {
|
||||||
idIdx: index("builds_id_idx").using("btree", table.id.asc().nullsLast().op("int4_ops")),
|
|
||||||
uuidIdx: index("builds_uuid_idx").using("btree", table.uuid.asc().nullsLast().op("uuid_ops")),
|
|
||||||
buildsUuidUnique: unique("builds_uuid_unique").on(table.uuid),
|
buildsUuidUnique: unique("builds_uuid_unique").on(table.uuid),
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
export const balAccounts = pgTable("bal_accounts", {
|
|
||||||
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "accountsid_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
|
||||||
firstName: varchar("first_name", { length: 40 }),
|
|
||||||
lastName: varchar("last_name", { length: 40 }),
|
|
||||||
updatedAt: timestamp("updated_at", { mode: 'string' }).defaultNow().notNull(),
|
|
||||||
createdAt: timestamp("created_at", { mode: 'string' }).defaultNow().notNull(),
|
|
||||||
deletedAt: timestamp("deleted_at", { mode: 'string' }),
|
|
||||||
email: varchar({ length: 100 }),
|
|
||||||
username: varchar({ length: 50 }).notNull(),
|
|
||||||
passwordHash: varchar("password_hash", { length: 255 }).notNull(),
|
|
||||||
uuid: uuid().defaultRandom(),
|
|
||||||
}, (table) => {
|
|
||||||
return {
|
|
||||||
balAccountsUsernameUnique: unique("bal_accounts_username_unique").on(table.username),
|
|
||||||
balAccountsPasswordHashUnique: unique("bal_accounts_password_hash_unique").on(table.passwordHash),
|
|
||||||
balAccountsUuidUnique: unique("bal_accounts_uuid_unique").on(table.uuid),
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
export const brownells = pgTable("brownells", {
|
|
||||||
sku: text(),
|
|
||||||
manufacturerId: text("manufacturer_id"),
|
|
||||||
brandName: text("brand_name"),
|
|
||||||
productName: text("product_name"),
|
|
||||||
longDescription: text("long_description"),
|
|
||||||
shortDescription: text("short_description"),
|
|
||||||
department: text(),
|
|
||||||
category: text(),
|
|
||||||
subcategory: text(),
|
|
||||||
thumbUrl: text("thumb_url"),
|
|
||||||
imageUrl: text("image_url"),
|
|
||||||
buyLink: text("buy_link"),
|
|
||||||
keywords: text(),
|
|
||||||
reviews: text(),
|
|
||||||
retailPrice: numeric("retail_price"),
|
|
||||||
salePrice: numeric("sale_price"),
|
|
||||||
brandPageLink: text("brand_page_link"),
|
|
||||||
brandLogoImage: text("brand_logo_image"),
|
|
||||||
productPageViewTracking: text("product_page_view_tracking"),
|
|
||||||
parentGroupId: text("parent_group_id"),
|
|
||||||
color: text(),
|
|
||||||
size: text(),
|
|
||||||
pattern: text(),
|
|
||||||
material: text(),
|
|
||||||
ageGroup: text("age_group"),
|
|
||||||
gender: text(),
|
|
||||||
upc: text(),
|
|
||||||
availability: text(),
|
|
||||||
googleProductCategory: text("google_product_category"),
|
|
||||||
mediumImageUrl: text("medium_image_url"),
|
|
||||||
variantsXml: text("variants_xml"),
|
|
||||||
gtin: text(),
|
|
||||||
keyWords: text("key_words"),
|
|
||||||
productContentWidget: text("product_content_widget"),
|
|
||||||
googleCategorization: text("google_categorization"),
|
|
||||||
itemBasedCommission: text("item_based_commission"),
|
|
||||||
itemBasedCommissionRate: text("item_based_commission_rate"),
|
|
||||||
itemBasedCommissionRule: text("item_based_commission_rule"),
|
|
||||||
});
|
|
||||||
|
|
||||||
export const psa = pgTable("psa", {
|
export const psa = pgTable("psa", {
|
||||||
sku: varchar("SKU", { length: 50 }),
|
sku: varchar("SKU", { length: 50 }),
|
||||||
manufacturerId: varchar("MANUFACTURER_ID", { length: 50 }),
|
manufacturerId: varchar("MANUFACTURER_ID", { length: 50 }),
|
||||||
@@ -285,31 +223,6 @@ export const psa = pgTable("psa", {
|
|||||||
uuid: uuid().defaultRandom(),
|
uuid: uuid().defaultRandom(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const users = pgTable("users", {
|
|
||||||
id: bigserial({ mode: "bigint" }).primaryKey().notNull(),
|
|
||||||
username: varchar({ length: 50 }).notNull(),
|
|
||||||
email: varchar({ length: 255 }).notNull(),
|
|
||||||
passwordHash: varchar("password_hash", { length: 255 }).notNull(),
|
|
||||||
firstName: varchar("first_name", { length: 50 }),
|
|
||||||
lastName: varchar("last_name", { length: 50 }),
|
|
||||||
profilePicture: varchar("profile_picture", { length: 255 }),
|
|
||||||
dateOfBirth: date("date_of_birth"),
|
|
||||||
phoneNumber: varchar("phone_number", { length: 20 }),
|
|
||||||
createdAt: timestamp("created_at", { mode: 'string' }).default(sql`CURRENT_TIMESTAMP`),
|
|
||||||
updatedAt: timestamp("updated_at", { mode: 'string' }).default(sql`CURRENT_TIMESTAMP`),
|
|
||||||
isAdmin: boolean("is_admin").default(false),
|
|
||||||
lastLogin: timestamp("last_login", { mode: 'string' }),
|
|
||||||
emailVerified: boolean("email_verified").default(false),
|
|
||||||
buildPrivacySetting: text("build_privacy_setting").default('public'),
|
|
||||||
uuid: uuid().defaultRandom(),
|
|
||||||
}, (table) => {
|
|
||||||
return {
|
|
||||||
usersUsernameKey: unique("users_username_key").on(table.username),
|
|
||||||
usersEmailKey: unique("users_email_key").on(table.email),
|
|
||||||
usersBuildPrivacySettingCheck: check("users_build_privacy_setting_check", sql`build_privacy_setting = ANY (ARRAY['private'::text, 'public'::text])`),
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
export const lipseycatalog = pgTable("lipseycatalog", {
|
export const lipseycatalog = pgTable("lipseycatalog", {
|
||||||
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "lipseycatalog_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "lipseycatalog_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||||
itemno: varchar({ length: 20 }).notNull(),
|
itemno: varchar({ length: 20 }).notNull(),
|
||||||
@@ -422,7 +335,52 @@ export const balResellers = pgTable("bal_resellers", {
|
|||||||
balResellersUuidUnique: unique("bal_resellers_uuid_unique").on(table.uuid),
|
balResellersUuidUnique: unique("bal_resellers_uuid_unique").on(table.uuid),
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
export const vwProducts = pgView("vw_products", { aeroSku: text("aero_sku"),
|
|
||||||
aeroCategory: text("aero_category"),
|
export const verificationToken = pgTable("verificationToken", {
|
||||||
aeroProductName: text("aero_product_name"),
|
identifier: text().notNull(),
|
||||||
}).as(sql`SELECT aero.sku AS aero_sku, aero.category AS aero_category, aero.product_name AS aero_product_name FROM aero_precision aero WHERE aero.department = 'Stripped Lowers'::text UNION ALL SELECT psa."SKU" AS aero_sku, psa."CATEGORY" AS aero_category, psa."PRODUCT_NAME" AS aero_product_name FROM psa psa WHERE psa."FINELINE"::text = 'AR Complete Lowers'::text`);
|
token: text().notNull(),
|
||||||
|
expires: timestamp({ mode: 'string' }).notNull(),
|
||||||
|
}, (table) => {
|
||||||
|
return {
|
||||||
|
verificationTokenIdentifierTokenPk: primaryKey({ columns: [table.identifier, table.token], name: "verificationToken_identifier_token_pk"}),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export const authenticator = pgTable("authenticator", {
|
||||||
|
credentialId: text().notNull(),
|
||||||
|
userId: text().notNull(),
|
||||||
|
providerAccountId: text().notNull(),
|
||||||
|
credentialPublicKey: text().notNull(),
|
||||||
|
counter: integer().notNull(),
|
||||||
|
credentialDeviceType: text().notNull(),
|
||||||
|
credentialBackedUp: boolean().notNull(),
|
||||||
|
transports: text(),
|
||||||
|
}, (table) => {
|
||||||
|
return {
|
||||||
|
authenticatorUserIdUserIdFk: foreignKey({
|
||||||
|
columns: [table.userId],
|
||||||
|
foreignColumns: [user.id],
|
||||||
|
name: "authenticator_userId_user_id_fk"
|
||||||
|
}).onDelete("cascade"),
|
||||||
|
authenticatorUserIdCredentialIdPk: primaryKey({ columns: [table.credentialId, table.userId], name: "authenticator_userId_credentialID_pk"}),
|
||||||
|
authenticatorCredentialIdUnique: unique("authenticator_credentialID_unique").on(table.credentialId),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export const account = pgTable("account", {
|
||||||
|
userId: text().notNull(),
|
||||||
|
type: text().notNull(),
|
||||||
|
provider: text().notNull(),
|
||||||
|
providerAccountId: text().notNull(),
|
||||||
|
refreshToken: text("refresh_token"),
|
||||||
|
accessToken: text("access_token"),
|
||||||
|
expiresAt: integer("expires_at"),
|
||||||
|
tokenType: text("token_type"),
|
||||||
|
scope: text(),
|
||||||
|
idToken: text("id_token"),
|
||||||
|
sessionState: text("session_state"),
|
||||||
|
}, (table) => {
|
||||||
|
return {
|
||||||
|
accountProviderProviderAccountIdPk: primaryKey({ columns: [table.provider, table.providerAccountId], name: "account_provider_providerAccountId_pk"}),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|||||||
349
src/drizzle/schema/0000_stiff_odin.sql
Normal file
349
src/drizzle/schema/0000_stiff_odin.sql
Normal file
@@ -0,0 +1,349 @@
|
|||||||
|
-- Current sql file was generated after introspecting the database
|
||||||
|
-- If you want to run this migration please uncomment this code before executing migrations
|
||||||
|
/*
|
||||||
|
CREATE TABLE IF NOT EXISTS "products" (
|
||||||
|
"id" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "products_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
|
||||||
|
"name" varchar(255) NOT NULL,
|
||||||
|
"description" text NOT NULL,
|
||||||
|
"price" numeric NOT NULL,
|
||||||
|
"reseller_id" integer NOT NULL,
|
||||||
|
"category_id" integer NOT NULL,
|
||||||
|
"stock_qty" integer DEFAULT 0,
|
||||||
|
"updated_at" timestamp DEFAULT now() NOT NULL,
|
||||||
|
"created_at" timestamp DEFAULT now() NOT NULL,
|
||||||
|
"deleted_at" timestamp
|
||||||
|
);
|
||||||
|
--> statement-breakpoint
|
||||||
|
CREATE TABLE IF NOT EXISTS "users" (
|
||||||
|
"id" bigserial PRIMARY KEY NOT NULL,
|
||||||
|
"username" varchar(50) NOT NULL,
|
||||||
|
"email" varchar(255) NOT NULL,
|
||||||
|
"password_hash" varchar(255) NOT NULL,
|
||||||
|
"first_name" varchar(50),
|
||||||
|
"last_name" varchar(50),
|
||||||
|
"profile_picture" varchar(255),
|
||||||
|
"date_of_birth" date,
|
||||||
|
"phone_number" varchar(20),
|
||||||
|
"created_at" timestamp DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"updated_at" timestamp DEFAULT CURRENT_TIMESTAMP,
|
||||||
|
"is_admin" boolean DEFAULT false,
|
||||||
|
"last_login" timestamp,
|
||||||
|
"email_verified" boolean DEFAULT false,
|
||||||
|
"build_privacy_setting" text DEFAULT 'public',
|
||||||
|
"uuid" uuid DEFAULT gen_random_uuid(),
|
||||||
|
CONSTRAINT "users_username_key" UNIQUE("username"),
|
||||||
|
CONSTRAINT "users_email_key" UNIQUE("email"),
|
||||||
|
CONSTRAINT "users_build_privacy_setting_check" CHECK (build_privacy_setting = ANY (ARRAY['private'::text, 'public'::text]))
|
||||||
|
);
|
||||||
|
--> statement-breakpoint
|
||||||
|
CREATE TABLE IF NOT EXISTS "categories" (
|
||||||
|
"id" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "categories_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
|
||||||
|
"name" varchar(100) NOT NULL,
|
||||||
|
"parent_category_id" integer,
|
||||||
|
"updated_at" timestamp DEFAULT now() NOT NULL,
|
||||||
|
"created_at" timestamp DEFAULT now() NOT NULL,
|
||||||
|
"deleted_at" timestamp,
|
||||||
|
"uuid" uuid DEFAULT gen_random_uuid()
|
||||||
|
);
|
||||||
|
--> statement-breakpoint
|
||||||
|
CREATE TABLE IF NOT EXISTS "product_feeds" (
|
||||||
|
"id" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "productfeeds_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
|
||||||
|
"reseller_id" integer NOT NULL,
|
||||||
|
"feed_url" varchar(255) NOT NULL,
|
||||||
|
"last_update" timestamp,
|
||||||
|
"updated_at" timestamp DEFAULT now() NOT NULL,
|
||||||
|
"created_at" timestamp DEFAULT now() NOT NULL,
|
||||||
|
"deleted_at" timestamp,
|
||||||
|
"uuid" uuid DEFAULT gen_random_uuid(),
|
||||||
|
CONSTRAINT "product_feeds_uuid_unique" UNIQUE("uuid")
|
||||||
|
);
|
||||||
|
--> statement-breakpoint
|
||||||
|
CREATE TABLE IF NOT EXISTS "user" (
|
||||||
|
"id" text PRIMARY KEY NOT NULL,
|
||||||
|
"name" text,
|
||||||
|
"email" text,
|
||||||
|
"emailVerified" timestamp,
|
||||||
|
"image" text,
|
||||||
|
CONSTRAINT "user_email_unique" UNIQUE("email")
|
||||||
|
);
|
||||||
|
--> statement-breakpoint
|
||||||
|
CREATE TABLE IF NOT EXISTS "user_activity_log" (
|
||||||
|
"id" bigint PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "user_activity_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
|
||||||
|
"user_id" bigint NOT NULL,
|
||||||
|
"activity" text NOT NULL,
|
||||||
|
"timestamp" timestamp DEFAULT CURRENT_TIMESTAMP
|
||||||
|
);
|
||||||
|
--> statement-breakpoint
|
||||||
|
CREATE TABLE IF NOT EXISTS "brands" (
|
||||||
|
"id" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "brands_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
|
||||||
|
"name" varchar(100) NOT NULL,
|
||||||
|
"updated_at" timestamp DEFAULT now() NOT NULL,
|
||||||
|
"created_at" timestamp DEFAULT now() NOT NULL,
|
||||||
|
"deleted_at" timestamp,
|
||||||
|
"uuid" uuid DEFAULT gen_random_uuid(),
|
||||||
|
CONSTRAINT "brands_uuid_unique" UNIQUE("uuid")
|
||||||
|
);
|
||||||
|
--> statement-breakpoint
|
||||||
|
CREATE TABLE IF NOT EXISTS "manufacturer" (
|
||||||
|
"id" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "manufacturer_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
|
||||||
|
"name" varchar(100) NOT NULL,
|
||||||
|
"updated_at" timestamp DEFAULT now() NOT NULL,
|
||||||
|
"created_at" timestamp DEFAULT now() NOT NULL,
|
||||||
|
"deleted_at" timestamp,
|
||||||
|
"uuid" uuid DEFAULT gen_random_uuid(),
|
||||||
|
CONSTRAINT "manufacturer_uuid_unique" UNIQUE("uuid")
|
||||||
|
);
|
||||||
|
--> statement-breakpoint
|
||||||
|
CREATE TABLE IF NOT EXISTS "session" (
|
||||||
|
"sessionToken" text PRIMARY KEY NOT NULL,
|
||||||
|
"userId" text NOT NULL,
|
||||||
|
"expires" timestamp NOT NULL
|
||||||
|
);
|
||||||
|
--> statement-breakpoint
|
||||||
|
CREATE TABLE IF NOT EXISTS "states" (
|
||||||
|
"id" integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (sequence name "states_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
|
||||||
|
"state" varchar(50),
|
||||||
|
"abbreviation" varchar(50)
|
||||||
|
);
|
||||||
|
--> statement-breakpoint
|
||||||
|
CREATE TABLE IF NOT EXISTS "component_type" (
|
||||||
|
"id" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "component_type_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
|
||||||
|
"name" varchar(100) NOT NULL,
|
||||||
|
"updated_at" timestamp DEFAULT now() NOT NULL,
|
||||||
|
"created_at" timestamp DEFAULT now() NOT NULL,
|
||||||
|
"deleted_at" timestamp,
|
||||||
|
"uuid" uuid DEFAULT gen_random_uuid(),
|
||||||
|
CONSTRAINT "component_type_uuid_unique" UNIQUE("uuid")
|
||||||
|
);
|
||||||
|
--> statement-breakpoint
|
||||||
|
CREATE TABLE IF NOT EXISTS "aero_precision" (
|
||||||
|
"sku" text PRIMARY KEY NOT NULL,
|
||||||
|
"manufacturer_id" text,
|
||||||
|
"brand_name" text,
|
||||||
|
"product_name" text,
|
||||||
|
"long_description" text,
|
||||||
|
"short_description" text,
|
||||||
|
"department" text,
|
||||||
|
"category" text,
|
||||||
|
"subcategory" text,
|
||||||
|
"thumb_url" text,
|
||||||
|
"image_url" text,
|
||||||
|
"buy_link" text,
|
||||||
|
"keywords" text,
|
||||||
|
"reviews" text,
|
||||||
|
"retail_price" numeric,
|
||||||
|
"sale_price" numeric,
|
||||||
|
"brand_page_link" text,
|
||||||
|
"brand_logo_image" text,
|
||||||
|
"product_page_view_tracking" text,
|
||||||
|
"variants_xml" text,
|
||||||
|
"medium_image_url" text,
|
||||||
|
"product_content_widget" text,
|
||||||
|
"google_categorization" text,
|
||||||
|
"item_based_commission" text,
|
||||||
|
"uuid" uuid DEFAULT gen_random_uuid()
|
||||||
|
);
|
||||||
|
--> statement-breakpoint
|
||||||
|
CREATE TABLE IF NOT EXISTS "compartment" (
|
||||||
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||||
|
"name" varchar(100) NOT NULL,
|
||||||
|
"description" varchar(300),
|
||||||
|
"updated_at" timestamp DEFAULT now() NOT NULL,
|
||||||
|
"created_at" timestamp DEFAULT now() NOT NULL,
|
||||||
|
"deleted_at" timestamp
|
||||||
|
);
|
||||||
|
--> statement-breakpoint
|
||||||
|
CREATE TABLE IF NOT EXISTS "builds" (
|
||||||
|
"id" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "build_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
|
||||||
|
"account_id" integer NOT NULL,
|
||||||
|
"name" varchar(255) NOT NULL,
|
||||||
|
"description" text,
|
||||||
|
"updated_at" timestamp DEFAULT now() NOT NULL,
|
||||||
|
"created_at" timestamp DEFAULT now() NOT NULL,
|
||||||
|
"deleted_at" timestamp,
|
||||||
|
"uuid" uuid DEFAULT gen_random_uuid(),
|
||||||
|
CONSTRAINT "builds_uuid_unique" UNIQUE("uuid")
|
||||||
|
);
|
||||||
|
--> statement-breakpoint
|
||||||
|
CREATE TABLE IF NOT EXISTS "psa" (
|
||||||
|
"SKU" varchar(50),
|
||||||
|
"MANUFACTURER_ID" varchar(50),
|
||||||
|
"BRAND_NAME" varchar(50),
|
||||||
|
"PRODUCT_NAME" varchar(255),
|
||||||
|
"LONG_DESCRIPTION" text,
|
||||||
|
"SHORT_DESCRIPTION" varchar(50),
|
||||||
|
"DEPARTMENT" varchar(50),
|
||||||
|
"CATEGORY" varchar(50),
|
||||||
|
"SUBCATEGORY" varchar(50),
|
||||||
|
"THUMB_URL" varchar(50),
|
||||||
|
"IMAGE_URL" varchar(50),
|
||||||
|
"BUY_LINK" varchar(128),
|
||||||
|
"KEYWORDS" varchar(50),
|
||||||
|
"REVIEWS" varchar(50),
|
||||||
|
"RETAIL_PRICE" real,
|
||||||
|
"SALE_PRICE" real,
|
||||||
|
"BRAND_PAGE_LINK" varchar(50),
|
||||||
|
"BRAND_LOGO_IMAGE" varchar(50),
|
||||||
|
"PRODUCT_PAGE_VIEW_TRACKING" varchar(256),
|
||||||
|
"PARENT_GROUP_ID" varchar(50),
|
||||||
|
"FINELINE" varchar(50),
|
||||||
|
"SUPERFINELINE" varchar(200),
|
||||||
|
"MODELNUMBER" varchar(50),
|
||||||
|
"CALIBER" varchar(200),
|
||||||
|
"UPC" varchar(100),
|
||||||
|
"MEDIUM_IMAGE_URL" varchar(50),
|
||||||
|
"PRODUCT_CONTENT_WIDGET" varchar(256),
|
||||||
|
"GOOGLE_CATEGORIZATION" varchar(50),
|
||||||
|
"ITEM_BASED_COMMISSION" varchar(50),
|
||||||
|
"uuid" uuid DEFAULT gen_random_uuid()
|
||||||
|
);
|
||||||
|
--> statement-breakpoint
|
||||||
|
CREATE TABLE IF NOT EXISTS "lipseycatalog" (
|
||||||
|
"id" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "lipseycatalog_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
|
||||||
|
"itemno" varchar(20) NOT NULL,
|
||||||
|
"description1" text,
|
||||||
|
"description2" text,
|
||||||
|
"upc" varchar(20),
|
||||||
|
"manufacturermodelno" varchar(30),
|
||||||
|
"msrp" double precision,
|
||||||
|
"model" text,
|
||||||
|
"calibergauge" text,
|
||||||
|
"manufacturer" text,
|
||||||
|
"type" text,
|
||||||
|
"action" text,
|
||||||
|
"barrellength" text,
|
||||||
|
"capacity" text,
|
||||||
|
"finish" text,
|
||||||
|
"overalllength" text,
|
||||||
|
"receiver" text,
|
||||||
|
"safety" text,
|
||||||
|
"sights" text,
|
||||||
|
"stockframegrips" text,
|
||||||
|
"magazine" text,
|
||||||
|
"weight" text,
|
||||||
|
"imagename" text,
|
||||||
|
"chamber" text,
|
||||||
|
"drilledandtapped" text,
|
||||||
|
"rateoftwist" text,
|
||||||
|
"itemtype" text,
|
||||||
|
"additionalfeature1" text,
|
||||||
|
"additionalfeature2" text,
|
||||||
|
"additionalfeature3" text,
|
||||||
|
"shippingweight" text,
|
||||||
|
"boundbookmanufacturer" text,
|
||||||
|
"boundbookmodel" text,
|
||||||
|
"boundbooktype" text,
|
||||||
|
"nfathreadpattern" text,
|
||||||
|
"nfaattachmentmethod" text,
|
||||||
|
"nfabaffletype" text,
|
||||||
|
"silencercanbedisassembled" text,
|
||||||
|
"silencerconstructionmaterial" text,
|
||||||
|
"nfadbreduction" text,
|
||||||
|
"silenceroutsidediameter" text,
|
||||||
|
"nfaform3Caliber" text,
|
||||||
|
"opticmagnification" text,
|
||||||
|
"maintubesize" text,
|
||||||
|
"adjustableobjective" text,
|
||||||
|
"objectivesize" text,
|
||||||
|
"opticadjustments" text,
|
||||||
|
"illuminatedreticle" text,
|
||||||
|
"reticle" text,
|
||||||
|
"exclusive" text,
|
||||||
|
"quantity" varchar(10) DEFAULT NULL,
|
||||||
|
"allocated" text,
|
||||||
|
"onsale" text,
|
||||||
|
"price" double precision,
|
||||||
|
"currentprice" double precision,
|
||||||
|
"retailmap" double precision,
|
||||||
|
"fflrequired" text,
|
||||||
|
"sotrequired" text,
|
||||||
|
"exclusivetype" text,
|
||||||
|
"scopecoverincluded" text,
|
||||||
|
"special" text,
|
||||||
|
"sightstype" text,
|
||||||
|
"case" text,
|
||||||
|
"choke" text,
|
||||||
|
"dbreduction" text,
|
||||||
|
"family" text,
|
||||||
|
"finishtype" text,
|
||||||
|
"frame" text,
|
||||||
|
"griptype" varchar(30),
|
||||||
|
"handgunslidematerial" text,
|
||||||
|
"countryoforigin" varchar(4),
|
||||||
|
"itemlength" text,
|
||||||
|
"itemwidth" text,
|
||||||
|
"itemheight" text,
|
||||||
|
"packagelength" double precision,
|
||||||
|
"packagewidth" double precision,
|
||||||
|
"packageheight" double precision,
|
||||||
|
"itemgroup" varchar(40),
|
||||||
|
"updated_at" timestamp DEFAULT now() NOT NULL,
|
||||||
|
"created_at" timestamp DEFAULT now() NOT NULL,
|
||||||
|
"deleted_at" timestamp
|
||||||
|
);
|
||||||
|
--> statement-breakpoint
|
||||||
|
CREATE TABLE IF NOT EXISTS "builds_components" (
|
||||||
|
"id" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "build_components_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
|
||||||
|
"build_id" integer NOT NULL,
|
||||||
|
"product_id" integer NOT NULL,
|
||||||
|
"updated_at" timestamp DEFAULT now() NOT NULL,
|
||||||
|
"created_at" timestamp DEFAULT now() NOT NULL,
|
||||||
|
"deleted_at" timestamp,
|
||||||
|
"uuid" uuid DEFAULT gen_random_uuid(),
|
||||||
|
CONSTRAINT "builds_components_uuid_unique" UNIQUE("uuid")
|
||||||
|
);
|
||||||
|
--> statement-breakpoint
|
||||||
|
CREATE TABLE IF NOT EXISTS "bal_resellers" (
|
||||||
|
"id" integer PRIMARY KEY GENERATED ALWAYS AS IDENTITY (sequence name "resellers_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1),
|
||||||
|
"name" varchar(100) NOT NULL,
|
||||||
|
"website_url" varchar(255),
|
||||||
|
"contact_email" varchar(100),
|
||||||
|
"updated_at" timestamp DEFAULT now() NOT NULL,
|
||||||
|
"created_at" timestamp DEFAULT now() NOT NULL,
|
||||||
|
"deleted_at" timestamp,
|
||||||
|
"uuid" uuid DEFAULT gen_random_uuid(),
|
||||||
|
CONSTRAINT "bal_resellers_uuid_unique" UNIQUE("uuid")
|
||||||
|
);
|
||||||
|
--> statement-breakpoint
|
||||||
|
CREATE TABLE IF NOT EXISTS "verificationToken" (
|
||||||
|
"identifier" text NOT NULL,
|
||||||
|
"token" text NOT NULL,
|
||||||
|
"expires" timestamp NOT NULL,
|
||||||
|
CONSTRAINT "verificationToken_identifier_token_pk" PRIMARY KEY("identifier","token")
|
||||||
|
);
|
||||||
|
--> statement-breakpoint
|
||||||
|
CREATE TABLE IF NOT EXISTS "authenticator" (
|
||||||
|
"credentialID" text NOT NULL,
|
||||||
|
"userId" text NOT NULL,
|
||||||
|
"providerAccountId" text NOT NULL,
|
||||||
|
"credentialPublicKey" text NOT NULL,
|
||||||
|
"counter" integer NOT NULL,
|
||||||
|
"credentialDeviceType" text NOT NULL,
|
||||||
|
"credentialBackedUp" boolean NOT NULL,
|
||||||
|
"transports" text,
|
||||||
|
CONSTRAINT "authenticator_userId_credentialID_pk" PRIMARY KEY("credentialID","userId"),
|
||||||
|
CONSTRAINT "authenticator_credentialID_unique" UNIQUE("credentialID")
|
||||||
|
);
|
||||||
|
--> statement-breakpoint
|
||||||
|
CREATE TABLE IF NOT EXISTS "account" (
|
||||||
|
"userId" text NOT NULL,
|
||||||
|
"type" text NOT NULL,
|
||||||
|
"provider" text NOT NULL,
|
||||||
|
"providerAccountId" text NOT NULL,
|
||||||
|
"refresh_token" text,
|
||||||
|
"access_token" text,
|
||||||
|
"expires_at" integer,
|
||||||
|
"token_type" text,
|
||||||
|
"scope" text,
|
||||||
|
"id_token" text,
|
||||||
|
"session_state" text,
|
||||||
|
CONSTRAINT "account_provider_providerAccountId_pk" PRIMARY KEY("provider","providerAccountId")
|
||||||
|
);
|
||||||
|
--> statement-breakpoint
|
||||||
|
DO $$ BEGIN
|
||||||
|
ALTER TABLE "authenticator" ADD CONSTRAINT "authenticator_userId_user_id_fk" FOREIGN KEY ("userId") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;
|
||||||
|
EXCEPTION
|
||||||
|
WHEN duplicate_object THEN null;
|
||||||
|
END $$;
|
||||||
|
|
||||||
|
*/
|
||||||
2174
src/drizzle/schema/meta/0000_snapshot.json
Normal file
2174
src/drizzle/schema/meta/0000_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
13
src/drizzle/schema/meta/_journal.json
Normal file
13
src/drizzle/schema/meta/_journal.json
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
"version": "7",
|
||||||
|
"dialect": "postgresql",
|
||||||
|
"entries": [
|
||||||
|
{
|
||||||
|
"idx": 0,
|
||||||
|
"version": "7",
|
||||||
|
"when": 1734388473133,
|
||||||
|
"tag": "0000_stiff_odin",
|
||||||
|
"breakpoints": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
13
src/drizzle/schema/relations.ts
Normal file
13
src/drizzle/schema/relations.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { relations } from "drizzle-orm/relations";
|
||||||
|
import { user, authenticator } from "./schema";
|
||||||
|
|
||||||
|
export const authenticatorRelations = relations(authenticator, ({one}) => ({
|
||||||
|
user: one(user, {
|
||||||
|
fields: [authenticator.userId],
|
||||||
|
references: [user.id]
|
||||||
|
}),
|
||||||
|
}));
|
||||||
|
|
||||||
|
export const userRelations = relations(user, ({many}) => ({
|
||||||
|
authenticators: many(authenticator),
|
||||||
|
}));
|
||||||
386
src/drizzle/schema/schema.ts
Normal file
386
src/drizzle/schema/schema.ts
Normal file
@@ -0,0 +1,386 @@
|
|||||||
|
import { pgTable, integer, varchar, text, numeric, timestamp, unique, check, bigserial, date, boolean, uuid, bigint, real, doublePrecision, primaryKey, foreignKey } from "drizzle-orm/pg-core"
|
||||||
|
import { sql } from "drizzle-orm"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
export const products = pgTable("products", {
|
||||||
|
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "products_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||||
|
name: varchar({ length: 255 }).notNull(),
|
||||||
|
description: text().notNull(),
|
||||||
|
price: numeric().notNull(),
|
||||||
|
resellerId: integer("reseller_id").notNull(),
|
||||||
|
categoryId: integer("category_id").notNull(),
|
||||||
|
stockQty: integer("stock_qty").default(0),
|
||||||
|
updatedAt: timestamp("updated_at", { mode: 'string' }).defaultNow().notNull(),
|
||||||
|
createdAt: timestamp("created_at", { mode: 'string' }).defaultNow().notNull(),
|
||||||
|
deletedAt: timestamp("deleted_at", { mode: 'string' }),
|
||||||
|
});
|
||||||
|
|
||||||
|
export const users = pgTable("users", {
|
||||||
|
id: bigserial({ mode: "bigint" }).primaryKey().notNull(),
|
||||||
|
username: varchar({ length: 50 }).notNull(),
|
||||||
|
email: varchar({ length: 255 }).notNull(),
|
||||||
|
passwordHash: varchar("password_hash", { length: 255 }).notNull(),
|
||||||
|
firstName: varchar("first_name", { length: 50 }),
|
||||||
|
lastName: varchar("last_name", { length: 50 }),
|
||||||
|
profilePicture: varchar("profile_picture", { length: 255 }),
|
||||||
|
dateOfBirth: date("date_of_birth"),
|
||||||
|
phoneNumber: varchar("phone_number", { length: 20 }),
|
||||||
|
createdAt: timestamp("created_at", { mode: 'string' }).default(sql`CURRENT_TIMESTAMP`),
|
||||||
|
updatedAt: timestamp("updated_at", { mode: 'string' }).default(sql`CURRENT_TIMESTAMP`),
|
||||||
|
isAdmin: boolean("is_admin").default(false),
|
||||||
|
lastLogin: timestamp("last_login", { mode: 'string' }),
|
||||||
|
emailVerified: boolean("email_verified").default(false),
|
||||||
|
buildPrivacySetting: text("build_privacy_setting").default('public'),
|
||||||
|
uuid: uuid().defaultRandom(),
|
||||||
|
}, (table) => {
|
||||||
|
return {
|
||||||
|
usersUsernameKey: unique("users_username_key").on(table.username),
|
||||||
|
usersEmailKey: unique("users_email_key").on(table.email),
|
||||||
|
usersBuildPrivacySettingCheck: check("users_build_privacy_setting_check", sql`build_privacy_setting = ANY (ARRAY['private'::text, 'public'::text])`),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export const categories = pgTable("categories", {
|
||||||
|
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "categories_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||||
|
name: varchar({ length: 100 }).notNull(),
|
||||||
|
parentCategoryId: integer("parent_category_id"),
|
||||||
|
updatedAt: timestamp("updated_at", { mode: 'string' }).defaultNow().notNull(),
|
||||||
|
createdAt: timestamp("created_at", { mode: 'string' }).defaultNow().notNull(),
|
||||||
|
deletedAt: timestamp("deleted_at", { mode: 'string' }),
|
||||||
|
uuid: uuid().defaultRandom(),
|
||||||
|
});
|
||||||
|
|
||||||
|
export const productFeeds = pgTable("product_feeds", {
|
||||||
|
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "productfeeds_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||||
|
resellerId: integer("reseller_id").notNull(),
|
||||||
|
feedUrl: varchar("feed_url", { length: 255 }).notNull(),
|
||||||
|
lastUpdate: timestamp("last_update", { mode: 'string' }),
|
||||||
|
updatedAt: timestamp("updated_at", { mode: 'string' }).defaultNow().notNull(),
|
||||||
|
createdAt: timestamp("created_at", { mode: 'string' }).defaultNow().notNull(),
|
||||||
|
deletedAt: timestamp("deleted_at", { mode: 'string' }),
|
||||||
|
uuid: uuid().defaultRandom(),
|
||||||
|
}, (table) => {
|
||||||
|
return {
|
||||||
|
productFeedsUuidUnique: unique("product_feeds_uuid_unique").on(table.uuid),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export const user = pgTable("user", {
|
||||||
|
id: text().primaryKey().notNull(),
|
||||||
|
name: text(),
|
||||||
|
email: text(),
|
||||||
|
emailVerified: timestamp({ mode: 'string' }),
|
||||||
|
image: text(),
|
||||||
|
}, (table) => {
|
||||||
|
return {
|
||||||
|
userEmailUnique: unique("user_email_unique").on(table.email),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export const userActivityLog = pgTable("user_activity_log", {
|
||||||
|
// You can use { mode: "bigint" } if numbers are exceeding js number limitations
|
||||||
|
id: bigint({ mode: "number" }).primaryKey().generatedAlwaysAsIdentity({ name: "user_activity_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||||
|
// You can use { mode: "bigint" } if numbers are exceeding js number limitations
|
||||||
|
userId: bigint("user_id", { mode: "number" }).notNull(),
|
||||||
|
activity: text().notNull(),
|
||||||
|
timestamp: timestamp({ mode: 'string' }).default(sql`CURRENT_TIMESTAMP`),
|
||||||
|
});
|
||||||
|
|
||||||
|
export const brands = pgTable("brands", {
|
||||||
|
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "brands_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||||
|
name: varchar({ length: 100 }).notNull(),
|
||||||
|
updatedAt: timestamp("updated_at", { mode: 'string' }).defaultNow().notNull(),
|
||||||
|
createdAt: timestamp("created_at", { mode: 'string' }).defaultNow().notNull(),
|
||||||
|
deletedAt: timestamp("deleted_at", { mode: 'string' }),
|
||||||
|
uuid: uuid().defaultRandom(),
|
||||||
|
}, (table) => {
|
||||||
|
return {
|
||||||
|
brandsUuidUnique: unique("brands_uuid_unique").on(table.uuid),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export const manufacturer = pgTable("manufacturer", {
|
||||||
|
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "manufacturer_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||||
|
name: varchar({ length: 100 }).notNull(),
|
||||||
|
updatedAt: timestamp("updated_at", { mode: 'string' }).defaultNow().notNull(),
|
||||||
|
createdAt: timestamp("created_at", { mode: 'string' }).defaultNow().notNull(),
|
||||||
|
deletedAt: timestamp("deleted_at", { mode: 'string' }),
|
||||||
|
uuid: uuid().defaultRandom(),
|
||||||
|
}, (table) => {
|
||||||
|
return {
|
||||||
|
manufacturerUuidUnique: unique("manufacturer_uuid_unique").on(table.uuid),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export const session = pgTable("session", {
|
||||||
|
sessionToken: text().primaryKey().notNull(),
|
||||||
|
userId: text().notNull(),
|
||||||
|
expires: timestamp({ mode: 'string' }).notNull(),
|
||||||
|
});
|
||||||
|
|
||||||
|
export const states = pgTable("states", {
|
||||||
|
id: integer().primaryKey().generatedByDefaultAsIdentity({ name: "states_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||||
|
state: varchar({ length: 50 }),
|
||||||
|
abbreviation: varchar({ length: 50 }),
|
||||||
|
});
|
||||||
|
|
||||||
|
export const componentType = pgTable("component_type", {
|
||||||
|
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "component_type_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||||
|
name: varchar({ length: 100 }).notNull(),
|
||||||
|
updatedAt: timestamp("updated_at", { mode: 'string' }).defaultNow().notNull(),
|
||||||
|
createdAt: timestamp("created_at", { mode: 'string' }).defaultNow().notNull(),
|
||||||
|
deletedAt: timestamp("deleted_at", { mode: 'string' }),
|
||||||
|
uuid: uuid().defaultRandom(),
|
||||||
|
}, (table) => {
|
||||||
|
return {
|
||||||
|
componentTypeUuidUnique: unique("component_type_uuid_unique").on(table.uuid),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export const aeroPrecision = pgTable("aero_precision", {
|
||||||
|
sku: text().primaryKey().notNull(),
|
||||||
|
manufacturerId: text("manufacturer_id"),
|
||||||
|
brandName: text("brand_name"),
|
||||||
|
productName: text("product_name"),
|
||||||
|
longDescription: text("long_description"),
|
||||||
|
shortDescription: text("short_description"),
|
||||||
|
department: text(),
|
||||||
|
category: text(),
|
||||||
|
subcategory: text(),
|
||||||
|
thumbUrl: text("thumb_url"),
|
||||||
|
imageUrl: text("image_url"),
|
||||||
|
buyLink: text("buy_link"),
|
||||||
|
keywords: text(),
|
||||||
|
reviews: text(),
|
||||||
|
retailPrice: numeric("retail_price"),
|
||||||
|
salePrice: numeric("sale_price"),
|
||||||
|
brandPageLink: text("brand_page_link"),
|
||||||
|
brandLogoImage: text("brand_logo_image"),
|
||||||
|
productPageViewTracking: text("product_page_view_tracking"),
|
||||||
|
variantsXml: text("variants_xml"),
|
||||||
|
mediumImageUrl: text("medium_image_url"),
|
||||||
|
productContentWidget: text("product_content_widget"),
|
||||||
|
googleCategorization: text("google_categorization"),
|
||||||
|
itemBasedCommission: text("item_based_commission"),
|
||||||
|
uuid: uuid().defaultRandom(),
|
||||||
|
});
|
||||||
|
|
||||||
|
export const compartment = pgTable("compartment", {
|
||||||
|
id: uuid().defaultRandom().primaryKey().notNull(),
|
||||||
|
name: varchar({ length: 100 }).notNull(),
|
||||||
|
description: varchar({ length: 300 }),
|
||||||
|
updatedAt: timestamp("updated_at", { mode: 'string' }).defaultNow().notNull(),
|
||||||
|
createdAt: timestamp("created_at", { mode: 'string' }).defaultNow().notNull(),
|
||||||
|
deletedAt: timestamp("deleted_at", { mode: 'string' }),
|
||||||
|
});
|
||||||
|
|
||||||
|
export const builds = pgTable("builds", {
|
||||||
|
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "build_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||||
|
accountId: integer("account_id").notNull(),
|
||||||
|
name: varchar({ length: 255 }).notNull(),
|
||||||
|
description: text(),
|
||||||
|
updatedAt: timestamp("updated_at", { mode: 'string' }).defaultNow().notNull(),
|
||||||
|
createdAt: timestamp("created_at", { mode: 'string' }).defaultNow().notNull(),
|
||||||
|
deletedAt: timestamp("deleted_at", { mode: 'string' }),
|
||||||
|
uuid: uuid().defaultRandom(),
|
||||||
|
}, (table) => {
|
||||||
|
return {
|
||||||
|
buildsUuidUnique: unique("builds_uuid_unique").on(table.uuid),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export const psa = pgTable("psa", {
|
||||||
|
sku: varchar("SKU", { length: 50 }),
|
||||||
|
manufacturerId: varchar("MANUFACTURER_ID", { length: 50 }),
|
||||||
|
brandName: varchar("BRAND_NAME", { length: 50 }),
|
||||||
|
productName: varchar("PRODUCT_NAME", { length: 255 }),
|
||||||
|
longDescription: text("LONG_DESCRIPTION"),
|
||||||
|
shortDescription: varchar("SHORT_DESCRIPTION", { length: 50 }),
|
||||||
|
department: varchar("DEPARTMENT", { length: 50 }),
|
||||||
|
category: varchar("CATEGORY", { length: 50 }),
|
||||||
|
subcategory: varchar("SUBCATEGORY", { length: 50 }),
|
||||||
|
thumbUrl: varchar("THUMB_URL", { length: 50 }),
|
||||||
|
imageUrl: varchar("IMAGE_URL", { length: 50 }),
|
||||||
|
buyLink: varchar("BUY_LINK", { length: 128 }),
|
||||||
|
keywords: varchar("KEYWORDS", { length: 50 }),
|
||||||
|
reviews: varchar("REVIEWS", { length: 50 }),
|
||||||
|
retailPrice: real("RETAIL_PRICE"),
|
||||||
|
salePrice: real("SALE_PRICE"),
|
||||||
|
brandPageLink: varchar("BRAND_PAGE_LINK", { length: 50 }),
|
||||||
|
brandLogoImage: varchar("BRAND_LOGO_IMAGE", { length: 50 }),
|
||||||
|
productPageViewTracking: varchar("PRODUCT_PAGE_VIEW_TRACKING", { length: 256 }),
|
||||||
|
parentGroupId: varchar("PARENT_GROUP_ID", { length: 50 }),
|
||||||
|
fineline: varchar("FINELINE", { length: 50 }),
|
||||||
|
superfineline: varchar("SUPERFINELINE", { length: 200 }),
|
||||||
|
modelnumber: varchar("MODELNUMBER", { length: 50 }),
|
||||||
|
caliber: varchar("CALIBER", { length: 200 }),
|
||||||
|
upc: varchar("UPC", { length: 100 }),
|
||||||
|
mediumImageUrl: varchar("MEDIUM_IMAGE_URL", { length: 50 }),
|
||||||
|
productContentWidget: varchar("PRODUCT_CONTENT_WIDGET", { length: 256 }),
|
||||||
|
googleCategorization: varchar("GOOGLE_CATEGORIZATION", { length: 50 }),
|
||||||
|
itemBasedCommission: varchar("ITEM_BASED_COMMISSION", { length: 50 }),
|
||||||
|
uuid: uuid().defaultRandom(),
|
||||||
|
});
|
||||||
|
|
||||||
|
export const lipseycatalog = pgTable("lipseycatalog", {
|
||||||
|
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "lipseycatalog_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||||
|
itemno: varchar({ length: 20 }).notNull(),
|
||||||
|
description1: text(),
|
||||||
|
description2: text(),
|
||||||
|
upc: varchar({ length: 20 }),
|
||||||
|
manufacturermodelno: varchar({ length: 30 }),
|
||||||
|
msrp: doublePrecision(),
|
||||||
|
model: text(),
|
||||||
|
calibergauge: text(),
|
||||||
|
manufacturer: text(),
|
||||||
|
type: text(),
|
||||||
|
action: text(),
|
||||||
|
barrellength: text(),
|
||||||
|
capacity: text(),
|
||||||
|
finish: text(),
|
||||||
|
overalllength: text(),
|
||||||
|
receiver: text(),
|
||||||
|
safety: text(),
|
||||||
|
sights: text(),
|
||||||
|
stockframegrips: text(),
|
||||||
|
magazine: text(),
|
||||||
|
weight: text(),
|
||||||
|
imagename: text(),
|
||||||
|
chamber: text(),
|
||||||
|
drilledandtapped: text(),
|
||||||
|
rateoftwist: text(),
|
||||||
|
itemtype: text(),
|
||||||
|
additionalfeature1: text(),
|
||||||
|
additionalfeature2: text(),
|
||||||
|
additionalfeature3: text(),
|
||||||
|
shippingweight: text(),
|
||||||
|
boundbookmanufacturer: text(),
|
||||||
|
boundbookmodel: text(),
|
||||||
|
boundbooktype: text(),
|
||||||
|
nfathreadpattern: text(),
|
||||||
|
nfaattachmentmethod: text(),
|
||||||
|
nfabaffletype: text(),
|
||||||
|
silencercanbedisassembled: text(),
|
||||||
|
silencerconstructionmaterial: text(),
|
||||||
|
nfadbreduction: text(),
|
||||||
|
silenceroutsidediameter: text(),
|
||||||
|
nfaform3Caliber: text(),
|
||||||
|
opticmagnification: text(),
|
||||||
|
maintubesize: text(),
|
||||||
|
adjustableobjective: text(),
|
||||||
|
objectivesize: text(),
|
||||||
|
opticadjustments: text(),
|
||||||
|
illuminatedreticle: text(),
|
||||||
|
reticle: text(),
|
||||||
|
exclusive: text(),
|
||||||
|
quantity: varchar({ length: 10 }).default(sql`NULL`),
|
||||||
|
allocated: text(),
|
||||||
|
onsale: text(),
|
||||||
|
price: doublePrecision(),
|
||||||
|
currentprice: doublePrecision(),
|
||||||
|
retailmap: doublePrecision(),
|
||||||
|
fflrequired: text(),
|
||||||
|
sotrequired: text(),
|
||||||
|
exclusivetype: text(),
|
||||||
|
scopecoverincluded: text(),
|
||||||
|
special: text(),
|
||||||
|
sightstype: text(),
|
||||||
|
case: text(),
|
||||||
|
choke: text(),
|
||||||
|
dbreduction: text(),
|
||||||
|
family: text(),
|
||||||
|
finishtype: text(),
|
||||||
|
frame: text(),
|
||||||
|
griptype: varchar({ length: 30 }),
|
||||||
|
handgunslidematerial: text(),
|
||||||
|
countryoforigin: varchar({ length: 4 }),
|
||||||
|
itemlength: text(),
|
||||||
|
itemwidth: text(),
|
||||||
|
itemheight: text(),
|
||||||
|
packagelength: doublePrecision(),
|
||||||
|
packagewidth: doublePrecision(),
|
||||||
|
packageheight: doublePrecision(),
|
||||||
|
itemgroup: varchar({ length: 40 }),
|
||||||
|
updatedAt: timestamp("updated_at", { mode: 'string' }).defaultNow().notNull(),
|
||||||
|
createdAt: timestamp("created_at", { mode: 'string' }).defaultNow().notNull(),
|
||||||
|
deletedAt: timestamp("deleted_at", { mode: 'string' }),
|
||||||
|
});
|
||||||
|
|
||||||
|
export const buildsComponents = pgTable("builds_components", {
|
||||||
|
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "build_components_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||||
|
buildId: integer("build_id").notNull(),
|
||||||
|
productId: integer("product_id").notNull(),
|
||||||
|
updatedAt: timestamp("updated_at", { mode: 'string' }).defaultNow().notNull(),
|
||||||
|
createdAt: timestamp("created_at", { mode: 'string' }).defaultNow().notNull(),
|
||||||
|
deletedAt: timestamp("deleted_at", { mode: 'string' }),
|
||||||
|
uuid: uuid().defaultRandom(),
|
||||||
|
}, (table) => {
|
||||||
|
return {
|
||||||
|
buildsComponentsUuidUnique: unique("builds_components_uuid_unique").on(table.uuid),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export const balResellers = pgTable("bal_resellers", {
|
||||||
|
id: integer().primaryKey().generatedAlwaysAsIdentity({ name: "resellers_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }),
|
||||||
|
name: varchar({ length: 100 }).notNull(),
|
||||||
|
websiteUrl: varchar("website_url", { length: 255 }),
|
||||||
|
contactEmail: varchar("contact_email", { length: 100 }),
|
||||||
|
updatedAt: timestamp("updated_at", { mode: 'string' }).defaultNow().notNull(),
|
||||||
|
createdAt: timestamp("created_at", { mode: 'string' }).defaultNow().notNull(),
|
||||||
|
deletedAt: timestamp("deleted_at", { mode: 'string' }),
|
||||||
|
uuid: uuid().defaultRandom(),
|
||||||
|
}, (table) => {
|
||||||
|
return {
|
||||||
|
balResellersUuidUnique: unique("bal_resellers_uuid_unique").on(table.uuid),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export const verificationToken = pgTable("verificationToken", {
|
||||||
|
identifier: text().notNull(),
|
||||||
|
token: text().notNull(),
|
||||||
|
expires: timestamp({ mode: 'string' }).notNull(),
|
||||||
|
}, (table) => {
|
||||||
|
return {
|
||||||
|
verificationTokenIdentifierTokenPk: primaryKey({ columns: [table.identifier, table.token], name: "verificationToken_identifier_token_pk"}),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export const authenticator = pgTable("authenticator", {
|
||||||
|
credentialId: text().notNull(),
|
||||||
|
userId: text().notNull(),
|
||||||
|
providerAccountId: text().notNull(),
|
||||||
|
credentialPublicKey: text().notNull(),
|
||||||
|
counter: integer().notNull(),
|
||||||
|
credentialDeviceType: text().notNull(),
|
||||||
|
credentialBackedUp: boolean().notNull(),
|
||||||
|
transports: text(),
|
||||||
|
}, (table) => {
|
||||||
|
return {
|
||||||
|
authenticatorUserIdUserIdFk: foreignKey({
|
||||||
|
columns: [table.userId],
|
||||||
|
foreignColumns: [user.id],
|
||||||
|
name: "authenticator_userId_user_id_fk"
|
||||||
|
}).onDelete("cascade"),
|
||||||
|
authenticatorUserIdCredentialIdPk: primaryKey({ columns: [table.credentialId, table.userId], name: "authenticator_userId_credentialID_pk"}),
|
||||||
|
authenticatorCredentialIdUnique: unique("authenticator_credentialID_unique").on(table.credentialId),
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
export const account = pgTable("account", {
|
||||||
|
userId: text().notNull(),
|
||||||
|
type: text().notNull(),
|
||||||
|
provider: text().notNull(),
|
||||||
|
providerAccountId: text().notNull(),
|
||||||
|
refreshToken: text("refresh_token"),
|
||||||
|
accessToken: text("access_token"),
|
||||||
|
expiresAt: integer("expires_at"),
|
||||||
|
tokenType: text("token_type"),
|
||||||
|
scope: text(),
|
||||||
|
idToken: text("id_token"),
|
||||||
|
sessionState: text("session_state"),
|
||||||
|
}, (table) => {
|
||||||
|
return {
|
||||||
|
accountProviderProviderAccountIdPk: primaryKey({ columns: [table.provider, table.providerAccountId], name: "account_provider_providerAccountId_pk"}),
|
||||||
|
}
|
||||||
|
});
|
||||||
@@ -27,7 +27,7 @@
|
|||||||
"@queries/*": [
|
"@queries/*": [
|
||||||
"./src/db/queries/*"],
|
"./src/db/queries/*"],
|
||||||
"@schemas/*": [
|
"@schemas/*": [
|
||||||
"./src/db/schema/*"],
|
"./src/drizzle/schema/*"],
|
||||||
"@db/*": [
|
"@db/*": [
|
||||||
"./src/db/*"],
|
"./src/db/*"],
|
||||||
"@types/*": [
|
"@types/*": [
|
||||||
|
|||||||
Reference in New Issue
Block a user