Commit 585f0b2f authored by wycers's avatar wycers
Browse files

create submission

parent 407f874e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@
		"@tiptap/extension-collaboration-cursor": "^2.2.4",
		"@tiptap/pm": "^2.2.4",
		"@tiptap/starter-kit": "^2.2.4",
		"axios": "^1.6.8",
		"clsx": "^2.1.0",
		"cmdk-sv": "^0.0.15",
		"formsnap": "^0.5.1",
@@ -87,10 +88,13 @@
		"highlight.js": "^11.9.0",
		"katex": "^0.16.9",
		"lodash": "^4.17.21",
		"minio": "^7.1.3",
		"moment": "^2.30.1",
		"monaco-editor": "^0.47.0",
		"mysql2": "^3.9.2",
		"nanoid": "^5.0.6",
		"oslo": "^1.1.3",
		"qiniu": "^7.11.1",
		"svelte-radix": "^1.0.3",
		"tailwind-merge": "^2.2.1",
		"tailwind-variants": "^0.2.0",
+615 −5

File changed.

Preview size limit exceeded, changes collapsed.

+18 −0
Original line number Diff line number Diff line
/*
  Warnings:

  - You are about to drop the column `storageKey` on the `File` table. All the data in the column will be lost.
  - You are about to drop the `Storage` table. If the table is not empty, all the data it contains will be lost.
  - Added the required column `volume` to the `File` table without a default value. This is not possible if the table is not empty.

*/
-- DropForeignKey
ALTER TABLE `File` DROP FOREIGN KEY `File_storageKey_fkey`;

-- AlterTable
ALTER TABLE `File` DROP COLUMN `storageKey`,
    ADD COLUMN `type` ENUM('QINIU', 'SUSTECH_MIRROR') NOT NULL DEFAULT 'QINIU',
    ADD COLUMN `volume` VARCHAR(191) NOT NULL;

-- DropTable
DROP TABLE `Storage`;
+6 −11
Original line number Diff line number Diff line
@@ -128,20 +128,15 @@ enum UserClassRole {

model File {
  id        String   @id
  size      Int
  createdAt DateTime @default(now())

  volume   String
  filename String
  storage      Storage     @relation(fields: [storageKey], references: [key])
  storageKey   String
  Submission   Submission? @relation(fields: [submissionId], references: [id])
  submissionId Int?
}

model Storage {
  key  String      @id
  size     Int
  type     StorageType @default(QINIU)
  File File[]

  submission   Submission? @relation(fields: [submissionId], references: [id])
  submissionId Int?
}

enum StorageType {
+31 −0
Original line number Diff line number Diff line
@@ -14,6 +14,37 @@ declare global {
		// interface PageState {}
		// interface Platform {}
	}
	namespace NodeJS {
		interface ProcessEnv {
			NODE_ENV: 'development' | 'production';

			PORT: string;

			DATABASE_TYPE: 'mysql' | 'mariadb';
			DATABASE_NAME: string;
			DATABASE_HOST: string;
			DATABASE_PORT: string;
			DATABASE_USER: string;
			DATABASE_PASSWORD: string;

			MINIO_HOST: string;
			MINIO_PORT: string;
			MINIO_USESSL: string;
			MINIO_USER: string;
			MINIO_PASSWORD: string;
			MINIO_BUCKET: string;

			IOJ_HOST: string;
			IOJ_TOKEN: string;

			REDIS_HOST: string;
			REDIS_PORT: string;

			QINIU_AK: string;
			QINIU_SK: string;
			QINIU_CALLBACK_URL: string;
		}
	}
}

export {};
Loading