-
-
Notifications
You must be signed in to change notification settings - Fork 83
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Validate Migration of Import Export Data (#251)
- Loading branch information
Showing
13 changed files
with
635 additions
and
125 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
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,8 @@ | ||
#!/bin/bash | ||
|
||
if [ "$NODE_ENV" == "production" ] | ||
then | ||
export $(echo $(cat .env.production.local | sed 's/#.*//g' | sed 's/\r//g' | xargs) | envsubst) | ||
else | ||
export $(echo $(cat .env.development.local | sed 's/#.*//g' | sed 's/\r//g' | xargs) | envsubst) | ||
fi |
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,11 @@ | ||
#!/bin/bash | ||
|
||
. $(dirname "$0")/env.sh | ||
|
||
PRISMA_FILE="schema.prisma" | ||
|
||
if [[ "$DATABASE_URL" =~ ^mysql.* ]]; then | ||
export PRISMA_FILE="schema_mysql.prisma" | ||
fi | ||
|
||
npx prisma studio --schema prisma/$PRISMA_FILE |
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 @@ | ||
import { Author, Post, Setting, Subscriber, Tag, Upload } from "@prisma/client"; | ||
|
||
export interface ITagSanitized { | ||
name: string; | ||
slug: string; | ||
} | ||
|
||
type SanitizedAuthor = Omit< | ||
Author, | ||
"id" | "password" | "role_id" | "verify_attempt_left" | ||
>; | ||
export interface IAuthorData extends SanitizedAuthor { | ||
setting: Omit<Setting, "id" | "author_id" | "client_token">; | ||
subscribers: Omit<Subscriber, "author_id" | "id" | "verify_attempt_left">[]; | ||
uploads: Omit<Upload, "id" | "author_id">[]; | ||
posts: (Omit<Post, "id" | "author_id"> & { | ||
tags: Omit<Tag, "id">[]; | ||
})[]; | ||
} | ||
|
||
export interface IImportExportData { | ||
authors: { | ||
[email: string]: IAuthorData; | ||
}; | ||
} |
Oops, something went wrong.