mirror of
https://codeberg.org/MarkusThielker/finances.git
synced 2025-07-01 11:09:18 +00:00
Initial commit
This commit is contained in:
commit
52aed24a96
48 changed files with 6980 additions and 0 deletions
|
@ -0,0 +1,22 @@
|
|||
-- CreateTable
|
||||
CREATE TABLE "lucia_user"
|
||||
(
|
||||
"id" TEXT NOT NULL,
|
||||
"username" TEXT NOT NULL,
|
||||
"password" TEXT NOT NULL,
|
||||
|
||||
CONSTRAINT "lucia_user_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateTable
|
||||
CREATE TABLE "lucia_session"
|
||||
(
|
||||
"id" TEXT NOT NULL,
|
||||
"userId" TEXT NOT NULL,
|
||||
"expiresAt" TIMESTAMP(3) NOT NULL,
|
||||
|
||||
CONSTRAINT "lucia_session_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-- CreateIndex
|
||||
CREATE UNIQUE INDEX "lucia_user_username_key" ON "lucia_user" ("username");
|
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 (i.e. Git)
|
||||
provider = "postgresql"
|
30
prisma/schema.prisma
Normal file
30
prisma/schema.prisma
Normal file
|
@ -0,0 +1,30 @@
|
|||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
provider = "postgresql"
|
||||
url = env("DATABASE_URL")
|
||||
}
|
||||
|
||||
model User {
|
||||
// lucia internal fields
|
||||
id String @id
|
||||
sessions Session[]
|
||||
|
||||
// custom fields
|
||||
username String @unique
|
||||
password String
|
||||
|
||||
@@map("lucia_user")
|
||||
}
|
||||
|
||||
model Session {
|
||||
// lucia internal fields
|
||||
id String @id
|
||||
userId String
|
||||
expiresAt DateTime
|
||||
user User @relation(references: [id], fields: [userId], onDelete: Cascade)
|
||||
|
||||
@@map("lucia_session")
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue