mirror of
https://github.com/hempyhemp/hh-auto-reply.git
synced 2026-06-08 18:04:57 +00:00
init
This commit is contained in:
10
prisma/migrations/20260505105535_init/migration.sql
Normal file
10
prisma/migrations/20260505105535_init/migration.sql
Normal file
@@ -0,0 +1,10 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "User" (
|
||||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
"telegramId" BIGINT NOT NULL,
|
||||
"username" TEXT,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "User_telegramId_key" ON "User"("telegramId");
|
||||
16
prisma/migrations/20260505114043_add_is_new/migration.sql
Normal file
16
prisma/migrations/20260505114043_add_is_new/migration.sql
Normal file
@@ -0,0 +1,16 @@
|
||||
-- RedefineTables
|
||||
PRAGMA defer_foreign_keys=ON;
|
||||
PRAGMA foreign_keys=OFF;
|
||||
CREATE TABLE "new_User" (
|
||||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
"telegramId" BIGINT NOT NULL,
|
||||
"username" TEXT,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"isNew" BOOLEAN NOT NULL DEFAULT true
|
||||
);
|
||||
INSERT INTO "new_User" ("createdAt", "id", "telegramId", "username") SELECT "createdAt", "id", "telegramId", "username" FROM "User";
|
||||
DROP TABLE "User";
|
||||
ALTER TABLE "new_User" RENAME TO "User";
|
||||
CREATE UNIQUE INDEX "User_telegramId_key" ON "User"("telegramId");
|
||||
PRAGMA foreign_keys=ON;
|
||||
PRAGMA defer_foreign_keys=OFF;
|
||||
2
prisma/migrations/20260505115109_init/migration.sql
Normal file
2
prisma/migrations/20260505115109_init/migration.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "User" ADD COLUMN "firstName" TEXT;
|
||||
23
prisma/migrations/20260506085123_init/migration.sql
Normal file
23
prisma/migrations/20260506085123_init/migration.sql
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `isNew` on the `User` table. All the data in the column will be lost.
|
||||
|
||||
*/
|
||||
-- RedefineTables
|
||||
PRAGMA defer_foreign_keys=ON;
|
||||
PRAGMA foreign_keys=OFF;
|
||||
CREATE TABLE "new_User" (
|
||||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
"telegramId" BIGINT NOT NULL,
|
||||
"username" TEXT,
|
||||
"firstName" TEXT,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"session" TEXT
|
||||
);
|
||||
INSERT INTO "new_User" ("createdAt", "firstName", "id", "telegramId", "username") SELECT "createdAt", "firstName", "id", "telegramId", "username" FROM "User";
|
||||
DROP TABLE "User";
|
||||
ALTER TABLE "new_User" RENAME TO "User";
|
||||
CREATE UNIQUE INDEX "User_telegramId_key" ON "User"("telegramId");
|
||||
PRAGMA foreign_keys=ON;
|
||||
PRAGMA defer_foreign_keys=OFF;
|
||||
2
prisma/migrations/20260506090341_init/migration.sql
Normal file
2
prisma/migrations/20260506090341_init/migration.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "User" ADD COLUMN "hhEmail" TEXT;
|
||||
7
prisma/migrations/20260506135445_resume/migration.sql
Normal file
7
prisma/migrations/20260506135445_resume/migration.sql
Normal file
@@ -0,0 +1,7 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "Resume" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"data" TEXT NOT NULL,
|
||||
"telegramId" BIGINT NOT NULL,
|
||||
CONSTRAINT "Resume_telegramId_fkey" FOREIGN KEY ("telegramId") REFERENCES "User" ("telegramId") ON DELETE CASCADE ON UPDATE CASCADE
|
||||
);
|
||||
19
prisma/migrations/20260506143836_prompt/migration.sql
Normal file
19
prisma/migrations/20260506143836_prompt/migration.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
-- RedefineTables
|
||||
PRAGMA defer_foreign_keys=ON;
|
||||
PRAGMA foreign_keys=OFF;
|
||||
CREATE TABLE "new_User" (
|
||||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
"telegramId" BIGINT NOT NULL,
|
||||
"username" TEXT,
|
||||
"firstName" TEXT,
|
||||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"session" TEXT,
|
||||
"hhEmail" TEXT,
|
||||
"prompt" TEXT NOT NULL DEFAULT 'Напиши сопроводительное письмо опираясь на резюме. Пиши грамотно и коротко, простым языком не официально. Пиши только текст самого письма, ты пишешь напрямую в компанию. Мне отвечать или делать ремарки не нужно.'
|
||||
);
|
||||
INSERT INTO "new_User" ("createdAt", "firstName", "hhEmail", "id", "session", "telegramId", "username") SELECT "createdAt", "firstName", "hhEmail", "id", "session", "telegramId", "username" FROM "User";
|
||||
DROP TABLE "User";
|
||||
ALTER TABLE "new_User" RENAME TO "User";
|
||||
CREATE UNIQUE INDEX "User_telegramId_key" ON "User"("telegramId");
|
||||
PRAGMA foreign_keys=ON;
|
||||
PRAGMA defer_foreign_keys=OFF;
|
||||
8
prisma/migrations/20260506144645_settings/migration.sql
Normal file
8
prisma/migrations/20260506144645_settings/migration.sql
Normal file
@@ -0,0 +1,8 @@
|
||||
-- CreateTable
|
||||
CREATE TABLE "Settings" (
|
||||
"id" TEXT NOT NULL PRIMARY KEY,
|
||||
"telegramId" BIGINT NOT NULL,
|
||||
"searchQuery" TEXT NOT NULL DEFAULT 'Vue',
|
||||
"maxApplies" INTEGER NOT NULL DEFAULT 1,
|
||||
CONSTRAINT "Settings_telegramId_fkey" FOREIGN KEY ("telegramId") REFERENCES "User" ("telegramId") ON DELETE CASCADE ON UPDATE CASCADE
|
||||
);
|
||||
21
prisma/migrations/20260506144929_settingsupd/migration.sql
Normal file
21
prisma/migrations/20260506144929_settingsupd/migration.sql
Normal file
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- The primary key for the `Settings` table will be changed. If it partially fails, the table could be left without primary key constraint.
|
||||
- You are about to drop the column `id` on the `Settings` table. All the data in the column will be lost.
|
||||
|
||||
*/
|
||||
-- RedefineTables
|
||||
PRAGMA defer_foreign_keys=ON;
|
||||
PRAGMA foreign_keys=OFF;
|
||||
CREATE TABLE "new_Settings" (
|
||||
"telegramId" BIGINT NOT NULL PRIMARY KEY,
|
||||
"searchQuery" TEXT NOT NULL DEFAULT 'Vue',
|
||||
"maxApplies" INTEGER NOT NULL DEFAULT 1,
|
||||
CONSTRAINT "Settings_telegramId_fkey" FOREIGN KEY ("telegramId") REFERENCES "User" ("telegramId") ON DELETE CASCADE ON UPDATE CASCADE
|
||||
);
|
||||
INSERT INTO "new_Settings" ("maxApplies", "searchQuery", "telegramId") SELECT "maxApplies", "searchQuery", "telegramId" FROM "Settings";
|
||||
DROP TABLE "Settings";
|
||||
ALTER TABLE "new_Settings" RENAME TO "Settings";
|
||||
PRAGMA foreign_keys=ON;
|
||||
PRAGMA defer_foreign_keys=OFF;
|
||||
3
prisma/migrations/migration_lock.toml
Normal file
3
prisma/migrations/migration_lock.toml
Normal file
@@ -0,0 +1,3 @@
|
||||
# Please do not edit this file manually
|
||||
# It should be added in your version-control system (e.g., Git)
|
||||
provider = "sqlite"
|
||||
42
prisma/schema.prisma
Normal file
42
prisma/schema.prisma
Normal file
@@ -0,0 +1,42 @@
|
||||
// This is your Prisma schema file,
|
||||
// learn more about it in the docs: https://pris.ly/d/prisma-schema
|
||||
|
||||
// Looking for ways to speed up your queries, or scale easily with your serverless or edge functions?
|
||||
// Try Prisma Accelerate: https://pris.ly/cli/accelerate-init
|
||||
|
||||
// output = "../src/generated/prisma"
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
provider = "sqlite"
|
||||
url = env("DATABASE_URL")
|
||||
}
|
||||
|
||||
model User {
|
||||
id Int @id @default(autoincrement())
|
||||
telegramId BigInt @unique
|
||||
username String?
|
||||
firstName String?
|
||||
createdAt DateTime @default(now())
|
||||
session String?
|
||||
hhEmail String?
|
||||
resumes Resume[]
|
||||
prompt String @default("Напиши сопроводительное письмо опираясь на резюме. Пиши грамотно и коротко, простым языком не официально. Пиши только текст самого письма, ты пишешь напрямую в компанию. Мне отвечать или делать ремарки не нужно.")
|
||||
Settings Settings?
|
||||
}
|
||||
|
||||
model Resume {
|
||||
id String @id
|
||||
user User @relation(references: [telegramId], fields: [telegramId], onDelete: Cascade)
|
||||
data String
|
||||
telegramId BigInt
|
||||
}
|
||||
|
||||
model Settings {
|
||||
telegramId BigInt @id
|
||||
user User @relation(references: [telegramId], fields: [telegramId], onDelete: Cascade)
|
||||
searchQuery String @default("Vue")
|
||||
maxApplies Int @default(1)
|
||||
}
|
||||
Reference in New Issue
Block a user