https://github.com/runmaxde/max-run
https://github.com/runmaxde/max-run
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/runmaxde/max-run
- Owner: runmaxde
- Created: 2021-11-14T21:40:11.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-02-27T08:56:28.000Z (over 1 year ago)
- Last Synced: 2025-07-29T08:58:05.358Z (11 months ago)
- Language: TypeScript
- Homepage: https://max.run
- Size: 552 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Personal Blog and Knowledge-Base
# Development
## DB: Prisma & PlantScale
### Initial Setup
#### 1. Create DB on PlanetScale
#### 2. Automatically copy migration data
- Head ove to `Settings` Tab
- Activate `Automatically copy migration data`
- Pick `Prisma` as Migration Framework
#### 3. Create branches and open locally
```
pscale branch create YOUR_DB_NAME initial-setup
pscale branch create YOUR_DB_NAME shadow
```
```shell
# Terminal 1
pscale connect YOUR_DB_NAME initial-setup --port 3309
```
```shell
# Terminal 2
pscale connect YOUR_DB_NAME shadow --port 3310
```
#### 4. Local `.env`
```
# .env
DATABASE_URL="mysql://root@127.0.0.1:3309/YOUR_DB_NAME"
SHADOW_DATABASE_URL="mysql://root@127.0.0.1:3310/YOUR_DB_NAME"
```
#### 5. Prisma schema adjustments
```
datasource db {
provider = "mysql"
url = env("DATABASE_URL")
shadowDatabaseUrl = env("SHADOW_DATABASE_URL")
referentialIntegrity = "prisma"
}
generator client {
provider = "prisma-client-js"
previewFeatures = ["referentialIntegrity"]
}
```
#### 6. Migrate Schema
```bash
npx prisma migrate dev --name init
```
#### 7. Deploy changes
```
pscale deploy-request create YOUR_DB_NAME initial-setup
```