Merge remote-tracking branch 'upstream/dev' into tags-in-public-collection

This commit is contained in:
Oliver Schwamb
2024-10-30 12:10:30 +01:00
266 changed files with 18575 additions and 6564 deletions
@@ -0,0 +1,8 @@
-- AlterEnum
ALTER TYPE "LinksRouteTo" ADD VALUE 'SINGLEFILE';
-- AlterTable
ALTER TABLE "User" ADD COLUMN "archiveAsSinglefile" BOOLEAN NOT NULL DEFAULT false;
-- AlterTable
ALTER TABLE "Link" ADD COLUMN "singlefile" text;
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "User" ADD COLUMN "unverifiedNewEmail" TEXT;
@@ -0,0 +1,11 @@
-- CreateTable
CREATE TABLE "PasswordResetToken" (
"identifier" TEXT NOT NULL,
"token" TEXT NOT NULL,
"expires" TIMESTAMP(3) NOT NULL,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP
);
-- CreateIndex
CREATE UNIQUE INDEX "PasswordResetToken_token_key" ON "PasswordResetToken"("token");
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Link" ALTER COLUMN "name" SET DEFAULT '';
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "User" ADD COLUMN "locale" TEXT NOT NULL DEFAULT 'en';
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "AccessToken" ADD COLUMN "isSession" BOOLEAN NOT NULL DEFAULT false;
@@ -0,0 +1,21 @@
/*
Warnings:
- The values [SINGLEFILE] on the enum `LinksRouteTo` will be removed. If these variants are still used in the database, this will fail.
- You are about to drop the column `archiveAsSinglefile` on the `User` table. All the data in the column will be lost.
*/
-- AlterEnum
BEGIN;
CREATE TYPE "LinksRouteTo_new" AS ENUM ('ORIGINAL', 'PDF', 'READABLE', 'MONOLITH', 'SCREENSHOT');
ALTER TABLE "User" ALTER COLUMN "linksRouteTo" DROP DEFAULT;
ALTER TABLE "User" ALTER COLUMN "linksRouteTo" TYPE "LinksRouteTo_new" USING ("linksRouteTo"::text::"LinksRouteTo_new");
ALTER TYPE "LinksRouteTo" RENAME TO "LinksRouteTo_old";
ALTER TYPE "LinksRouteTo_new" RENAME TO "LinksRouteTo";
DROP TYPE "LinksRouteTo_old";
ALTER TABLE "User" ALTER COLUMN "linksRouteTo" SET DEFAULT 'ORIGINAL';
COMMIT;
-- AlterTable
ALTER TABLE "User" DROP COLUMN "archiveAsSinglefile",
ADD COLUMN "archiveAsMonolith" BOOLEAN NOT NULL DEFAULT true;
@@ -0,0 +1,9 @@
/*
Warnings:
- You are about to drop the column `singlefile` on the `Link` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "Link" DROP COLUMN "singlefile",
ADD COLUMN "monolith" TEXT;
@@ -0,0 +1,8 @@
-- AlterTable
ALTER TABLE "Collection" ADD COLUMN "icon" TEXT,
ADD COLUMN "iconWeight" TEXT;
-- AlterTable
ALTER TABLE "Link" ADD COLUMN "color" TEXT,
ADD COLUMN "icon" TEXT,
ADD COLUMN "iconWeight" TEXT;
@@ -0,0 +1,3 @@
-- AlterTable
ALTER TABLE "Collection" ALTER COLUMN "color" DROP NOT NULL,
ALTER COLUMN "color" DROP DEFAULT;
@@ -0,0 +1,9 @@
/*
Warnings:
- Made the column `color` on table `Collection` required. This step will fail if there are existing NULL values in that column.
*/
-- AlterTable
ALTER TABLE "Collection" ALTER COLUMN "color" SET NOT NULL,
ALTER COLUMN "color" SET DEFAULT '#0ea5e9';
+22 -3
View File
@@ -31,20 +31,23 @@ model User {
username String? @unique
email String? @unique
emailVerified DateTime?
unverifiedNewEmail String?
image String?
accounts Account[]
password String?
locale String @default("en")
accounts Account[]
collections Collection[]
tags Tag[]
pinnedLinks Link[]
collectionsJoined UsersAndCollections[]
collectionOrder Int[] @default([])
collectionOrder Int[] @default([])
whitelistedUsers WhitelistedUser[]
accessTokens AccessToken[]
subscriptions Subscription?
linksRouteTo LinksRouteTo @default(ORIGINAL)
preventDuplicateLinks Boolean @default(false)
archiveAsScreenshot Boolean @default(true)
archiveAsMonolith Boolean @default(true)
archiveAsPDF Boolean @default(true)
archiveAsWaybackMachine Boolean @default(false)
isPrivate Boolean @default(false)
@@ -56,6 +59,7 @@ enum LinksRouteTo {
ORIGINAL
PDF
READABLE
MONOLITH
SCREENSHOT
}
@@ -78,10 +82,20 @@ model VerificationToken {
@@unique([identifier, token])
}
model PasswordResetToken {
identifier String
token String @unique
expires DateTime
createdAt DateTime @default(now())
updatedAt DateTime @default(now()) @updatedAt
}
model Collection {
id Int @id @default(autoincrement())
name String
description String @default("")
icon String?
iconWeight String?
color String @default("#0ea5e9")
parentId Int?
parent Collection? @relation("SubCollections", fields: [parentId], references: [id])
@@ -115,19 +129,23 @@ model UsersAndCollections {
model Link {
id Int @id @default(autoincrement())
name String
name String @default("")
type String @default("url")
description String @default("")
pinnedBy User[]
collection Collection @relation(fields: [collectionId], references: [id])
collectionId Int
tags Tag[]
icon String?
iconWeight String?
color String?
url String?
textContent String?
preview String?
image String?
pdf String?
readable String?
monolith String?
lastPreserved DateTime?
importDate DateTime?
createdAt DateTime @default(now())
@@ -166,6 +184,7 @@ model AccessToken {
userId Int
token String @unique
revoked Boolean @default(false)
isSession Boolean @default(false)
expires DateTime
lastUsedAt DateTime?
createdAt DateTime @default(now())