-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
104 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
packages/worker/prisma/migrations/20230409071929_resource_relation/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `teamId` on the `Resource` table. All the data in the column will be lost. | ||
- You are about to drop the column `userId` on the `Resource` table. All the data in the column will be lost. | ||
- Added the required column `publisherId` to the `Resource` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- DropForeignKey | ||
ALTER TABLE `Resource` DROP FOREIGN KEY `Resource_teamId_fkey`; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE `Resource` DROP FOREIGN KEY `Resource_userId_fkey`; | ||
|
||
-- AlterTable | ||
ALTER TABLE `Resource` DROP COLUMN `teamId`, | ||
DROP COLUMN `userId`, | ||
ADD COLUMN `fansubId` INTEGER NULL, | ||
ADD COLUMN `publisherId` INTEGER NOT NULL; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE `Resource` ADD CONSTRAINT `Resource_fansubId_fkey` FOREIGN KEY (`fansubId`) REFERENCES `Team`(`id`) ON DELETE SET NULL ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE `Resource` ADD CONSTRAINT `Resource_publisherId_fkey` FOREIGN KEY (`publisherId`) REFERENCES `User`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,3 @@ | ||
export interface Env { | ||
database: D1Database; | ||
} | ||
|
||
export interface TeamTable { | ||
id: number; | ||
|
||
name: string; | ||
} | ||
|
||
export interface UserTable { | ||
id: number; | ||
|
||
name: string; | ||
} | ||
|
||
export interface ResourceTable { | ||
title: string; | ||
|
||
href: string; | ||
|
||
type: string; | ||
|
||
magnet: string; | ||
|
||
size: string; | ||
|
||
fansub?: number; | ||
|
||
publisher: number; | ||
|
||
createdAt: number; | ||
} | ||
|
||
export interface Database { | ||
user: UserTable; | ||
|
||
team: TeamTable; | ||
|
||
resource: ResourceTable; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.