forked from ishiko732/ts-fsrs-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
453f200
commit 4034fac
Showing
5 changed files
with
127 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
POSTGRES_URL=postgres://default:ANP0lbi7JvpO@ep-wispy-sea-a4ze0cyc-pooler.us-east-1.aws.neon.tech:5432/verceldb?sslmode=require | ||
POSTGRES_PRISMA_URL=postgres://default:ANP0lbi7JvpO@ep-wispy-sea-a4ze0cyc-pooler.us-east-1.aws.neon.tech:5432/verceldb?sslmode=require&pgbouncer=true&connect_timeout=15 | ||
POSTGRES_URL_NO_SSL=postgres://default:ANP0lbi7JvpO@ep-wispy-sea-a4ze0cyc-pooler.us-east-1.aws.neon.tech:5432/verceldb | ||
POSTGRES_URL_NON_POOLING=postgres://default:[email protected]:5432/verceldb?sslmode=require | ||
POSTGRES_USER=default | ||
POSTGRES_HOST=ep-wispy-sea-a4ze0cyc-pooler.us-east-1.aws.neon.tech | ||
POSTGRES_PASSWORD=ANP0lbi7JvpO | ||
POSTGRES_DATABASE=verceldb | ||
|
||
DATABASE_URL=mysql://root:universe@localhost:3306/fsrs-test | ||
DATABASE_URL_WITH_SCHEMA=${DATABASE_URL}?schema=fsrs-test | ||
|
||
NEXTAUTH_URL=http://localhost:3000 | ||
NEXTAUTH_SECRET=pQghOlId0vuBpyDPgjIYg9y7nT3ZE82Mw6P0GKTBzU4 | ||
|
||
GITHUB_ID=Iv1.ad04977b82e036f1 | ||
GITHUB_SECRET=903036b6dd5f4d425413479ec227cb3522341aed |
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 |
---|---|---|
@@ -0,0 +1,96 @@ | ||
-- CreateTable | ||
CREATE TABLE `Revlog` ( | ||
`lid` VARCHAR(191) NOT NULL, | ||
`cid` INTEGER NOT NULL, | ||
`grade` ENUM('0', '1', '2', '3', '4') NOT NULL, | ||
`state` ENUM('0', '1', '2', '3') NOT NULL, | ||
`due` DATETIME(3) NOT NULL, | ||
`stability` DOUBLE NOT NULL, | ||
`difficulty` DOUBLE NOT NULL, | ||
`elapsed_days` INTEGER NOT NULL, | ||
`last_elapsed_days` INTEGER NOT NULL, | ||
`scheduled_days` INTEGER NOT NULL, | ||
`review` DATETIME(3) NOT NULL, | ||
`duration` INTEGER NOT NULL DEFAULT 0, | ||
|
||
UNIQUE INDEX `Revlog_lid_key`(`lid`), | ||
INDEX `Revlog_cid_idx`(`cid`), | ||
PRIMARY KEY (`lid`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- CreateTable | ||
CREATE TABLE `Card` ( | ||
`cid` INTEGER NOT NULL AUTO_INCREMENT, | ||
`due` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), | ||
`stability` DOUBLE NOT NULL, | ||
`difficulty` DOUBLE NOT NULL, | ||
`elapsed_days` INTEGER NOT NULL, | ||
`scheduled_days` INTEGER NOT NULL, | ||
`reps` INTEGER NOT NULL, | ||
`lapses` INTEGER NOT NULL, | ||
`state` ENUM('0', '1', '2', '3') NOT NULL DEFAULT '0', | ||
`last_review` DATETIME(3) NULL, | ||
`nid` INTEGER NOT NULL, | ||
|
||
UNIQUE INDEX `Card_cid_key`(`cid`), | ||
UNIQUE INDEX `Card_nid_key`(`nid`), | ||
PRIMARY KEY (`cid`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- CreateTable | ||
CREATE TABLE `Parameters` ( | ||
`uid` INTEGER NOT NULL AUTO_INCREMENT, | ||
`request_retention` DOUBLE NOT NULL DEFAULT 0.9, | ||
`maximum_interval` INTEGER NOT NULL DEFAULT 36500, | ||
`w` JSON NOT NULL, | ||
`enable_fuzz` BOOLEAN NOT NULL DEFAULT false, | ||
`card_limit` INTEGER NOT NULL DEFAULT 50, | ||
`lingq_token` VARCHAR(191) NULL, | ||
`lingq_counter` VARCHAR(191) NULL, | ||
|
||
UNIQUE INDEX `Parameters_uid_key`(`uid`), | ||
PRIMARY KEY (`uid`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- CreateTable | ||
CREATE TABLE `User` ( | ||
`uid` INTEGER NOT NULL AUTO_INCREMENT, | ||
`name` VARCHAR(191) NOT NULL, | ||
`password` VARCHAR(191) NOT NULL, | ||
`oauthId` VARCHAR(191) NOT NULL, | ||
`oauthType` VARCHAR(191) NOT NULL DEFAULT 'local', | ||
`email` VARCHAR(191) NOT NULL, | ||
|
||
UNIQUE INDEX `User_uid_key`(`uid`), | ||
UNIQUE INDEX `User_name_key`(`name`), | ||
UNIQUE INDEX `User_email_key`(`email`), | ||
PRIMARY KEY (`uid`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- CreateTable | ||
CREATE TABLE `Note` ( | ||
`nid` INTEGER NOT NULL AUTO_INCREMENT, | ||
`uid` INTEGER NOT NULL, | ||
`question` VARCHAR(191) NOT NULL DEFAULT '', | ||
`answer` VARCHAR(191) NOT NULL DEFAULT '', | ||
`source` VARCHAR(191) NOT NULL DEFAULT '', | ||
`sourceId` VARCHAR(191) NULL, | ||
`extend` JSON NOT NULL, | ||
|
||
UNIQUE INDEX `Note_nid_key`(`nid`), | ||
INDEX `Note_uid_idx`(`uid`), | ||
INDEX `Note_sourceId_source_idx`(`sourceId`, `source`), | ||
PRIMARY KEY (`nid`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE `Revlog` ADD CONSTRAINT `Revlog_cid_fkey` FOREIGN KEY (`cid`) REFERENCES `Card`(`cid`) ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE `Card` ADD CONSTRAINT `Card_nid_fkey` FOREIGN KEY (`nid`) REFERENCES `Note`(`nid`) ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE `User` ADD CONSTRAINT `User_uid_fkey` FOREIGN KEY (`uid`) REFERENCES `Parameters`(`uid`) ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE `Note` ADD CONSTRAINT `Note_uid_fkey` FOREIGN KEY (`uid`) REFERENCES `User`(`uid`) 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Please do not edit this file manually | ||
# It should be added in your version-control system (i.e. Git) | ||
provider = "mysql" |
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