feat: added file upload + dir creation

This commit is contained in:
Smigz 2025-05-01 20:59:01 -04:00
parent b1c295d2ac
commit eedab606f8
25 changed files with 965 additions and 103 deletions

View file

@ -0,0 +1,12 @@
-- CreateTable
CREATE TABLE "Session" (
"id" TEXT NOT NULL,
"sid" TEXT NOT NULL,
"data" TEXT NOT NULL,
"expiresAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "Session_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE UNIQUE INDEX "Session_sid_key" ON "Session"("sid");

View file

@ -0,0 +1,10 @@
/*
Warnings:
- Added the required column `mimetype` to the `File` table without a default value. This is not possible if the table is not empty.
- Added the required column `size` to the `File` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE "File" ADD COLUMN "mimetype" TEXT NOT NULL,
ADD COLUMN "size" INTEGER NOT NULL;

View file

@ -0,0 +1,17 @@
/*
Warnings:
- Added the required column `full_path` to the `Folder` table without a default value. This is not possible if the table is not empty.
- Added the required column `modification_date` to the `Folder` table without a default value. This is not possible if the table is not empty.
- Added the required column `parent_folder_id` to the `Folder` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE "Folder" ADD COLUMN "creation_date" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
ADD COLUMN "full_path" TEXT NOT NULL,
ADD COLUMN "modification_date" TIMESTAMP(3) NOT NULL,
ADD COLUMN "owner_user_id" INTEGER,
ADD COLUMN "parent_folder_id" INTEGER NOT NULL;
-- AddForeignKey
ALTER TABLE "Folder" ADD CONSTRAINT "Folder_owner_user_id_fkey" FOREIGN KEY ("owner_user_id") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;

View file

@ -0,0 +1,14 @@
/*
Warnings:
- You are about to drop the column `full_path` on the `Folder` table. All the data in the column will be lost.
- You are about to drop the column `parent_folder_id` on the `Folder` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "Folder" DROP COLUMN "full_path",
DROP COLUMN "parent_folder_id",
ADD COLUMN "parentId" INTEGER;
-- AddForeignKey
ALTER TABLE "Folder" ADD CONSTRAINT "Folder_parentId_fkey" FOREIGN KEY ("parentId") REFERENCES "Folder"("id") ON DELETE SET NULL ON UPDATE CASCADE;

View file

@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "Folder" ALTER COLUMN "modification_date" SET DEFAULT CURRENT_TIMESTAMP;