first commit

This commit is contained in:
2025-09-07 22:57:43 +00:00
commit 3bd542adbf
122 changed files with 45056 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
-- CreateTable
CREATE TABLE `Post` (
`id` VARCHAR(191) NOT NULL,
`subject` VARCHAR(191) NOT NULL,
`pubDate` DATETIME(3) NOT NULL,
`views` INTEGER NOT NULL,
`validViews` INTEGER NOT NULL,
`premiumViews` INTEGER NOT NULL,
`watchTime` INTEGER NOT NULL,
`publisher` VARCHAR(191) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

View File

@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE `Post` MODIFY `publisher` VARCHAR(191) NULL;

View File

@@ -0,0 +1,22 @@
/*
Warnings:
- You are about to drop the `Post` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropTable
DROP TABLE `Post`;
-- CreateTable
CREATE TABLE `content` (
`id` VARCHAR(191) NOT NULL,
`subject` VARCHAR(191) NOT NULL,
`pubDate` DATETIME(3) NOT NULL,
`views` INTEGER NOT NULL,
`validViews` INTEGER NOT NULL,
`premiumViews` INTEGER NOT NULL,
`watchTime` INTEGER NOT NULL,
`publisher` VARCHAR(191) NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

View File

@@ -0,0 +1,18 @@
-- CreateTable
CREATE TABLE `noticeBoard` (
`id` VARCHAR(191) NOT NULL,
`title` VARCHAR(191) NOT NULL,
`content` VARCHAR(191) NOT NULL,
`pubDate` DATETIME(3) NOT NULL,
`isDeleted` BOOLEAN NOT NULL DEFAULT false,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateTable
CREATE TABLE `noticeBoardTag` (
`id` VARCHAR(191) NOT NULL,
`name` VARCHAR(191) NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

View File

@@ -0,0 +1,23 @@
/*
Warnings:
- Added the required column `tag` to the `noticeBoard` table without a default value. This is not possible if the table is not empty.
*/
-- AlterTable
ALTER TABLE `content` ADD COLUMN `owner` VARCHAR(191) NULL;
-- AlterTable
ALTER TABLE `noticeBoard` ADD COLUMN `tag` VARCHAR(191) NOT NULL,
MODIFY `content` LONGTEXT NOT NULL;
-- CreateTable
CREATE TABLE `registerChannel` (
`id` VARCHAR(191) NOT NULL,
`email` VARCHAR(191) NOT NULL,
`handle` VARCHAR(191) NOT NULL,
`randomcode` VARCHAR(191) NOT NULL,
`createtime` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

View File

@@ -0,0 +1,11 @@
-- CreateTable
CREATE TABLE `userHandle` (
`id` VARCHAR(191) NOT NULL,
`email` VARCHAR(191) NOT NULL,
`handle` VARCHAR(191) NOT NULL,
`isApproved` BOOLEAN NOT NULL DEFAULT false,
`createtime` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3),
UNIQUE INDEX `userHandle_handle_key`(`handle`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

View File

@@ -0,0 +1,10 @@
-- DropIndex
DROP INDEX `userHandle_handle_key` ON `userHandle`;
-- CreateTable
CREATE TABLE `GlobalValue` (
`id` INTEGER NOT NULL DEFAULT 1,
`costPerView` DOUBLE NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

View File

@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE `userHandle` ADD COLUMN `icon` VARCHAR(191) NOT NULL DEFAULT '';

View File

@@ -0,0 +1,16 @@
/*
Warnings:
- You are about to drop the `GlobalValue` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropTable
DROP TABLE `GlobalValue`;
-- CreateTable
CREATE TABLE `costPerView` (
`id` INTEGER NOT NULL DEFAULT 1,
`costPerView` DOUBLE NOT NULL,
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

View File

@@ -0,0 +1,31 @@
/*
Warnings:
- You are about to drop the column `owner` on the `content` table. All the data in the column will be lost.
- You are about to drop the column `publisher` on the `content` table. All the data in the column will be lost.
- A unique constraint covering the columns `[handle]` on the table `userHandle` will be added. If there are existing duplicate values, this will fail.
*/
-- AlterTable
ALTER TABLE `content` DROP COLUMN `owner`,
DROP COLUMN `publisher`;
-- CreateTable
CREATE TABLE `ContentHandle` (
`id` VARCHAR(191) NOT NULL,
`contentId` VARCHAR(191) NOT NULL,
`handle` VARCHAR(191) NOT NULL,
UNIQUE INDEX `ContentHandle_contentId_key`(`contentId`),
INDEX `ContentHandle_handle_idx`(`handle`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- CreateIndex
CREATE UNIQUE INDEX `userHandle_handle_key` ON `userHandle`(`handle`);
-- AddForeignKey
ALTER TABLE `ContentHandle` ADD CONSTRAINT `ContentHandle_contentId_fkey` FOREIGN KEY (`contentId`) REFERENCES `content`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE;
-- AddForeignKey
ALTER TABLE `ContentHandle` ADD CONSTRAINT `ContentHandle_handle_fkey` FOREIGN KEY (`handle`) REFERENCES `userHandle`(`handle`) ON DELETE RESTRICT ON UPDATE CASCADE;

View File

@@ -0,0 +1,8 @@
-- CreateTable
CREATE TABLE `ViewPerDay` (
`date` DATETIME(3) NOT NULL,
`contented` VARCHAR(191) NOT NULL,
`validViewDay` INTEGER NOT NULL,
PRIMARY KEY (`date`, `contented`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

View File

@@ -0,0 +1,22 @@
/*
Warnings:
- You are about to drop the `noticeBoardTag` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropTable
DROP TABLE `noticeBoardTag`;
-- CreateTable
CREATE TABLE `contentDayView` (
`id` VARCHAR(191) NOT NULL,
`contentId` VARCHAR(191) NOT NULL,
`date` DATETIME(3) NOT NULL,
`views` INTEGER NOT NULL,
`validViews` INTEGER NOT NULL,
`premiumViews` INTEGER NOT NULL,
`watchTime` INTEGER NOT NULL,
UNIQUE INDEX `contentDayView_contentId_date_key`(`contentId`, `date`),
PRIMARY KEY (`id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

View File

@@ -0,0 +1,8 @@
/*
Warnings:
- You are about to drop the `ViewPerDay` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropTable
DROP TABLE `ViewPerDay`;

View 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 = "mysql"