Simplify database migrations and data management — no more manual database changes. Use schema files to keep everything under control.
# 1. Clone the repo
git clone https://github.com/45592858/DataV5.git --depth=1
# 2. Install dependencies
cd DataV5
npm install
# 3. Create the database
npm run schema-migrate:dev dev
# 4. Seed the data
npm run data-migrate:dev
# 5. (Optional) Query the data
npm run data-query:dev
Modify your schema (model files) under ./schema
(e.g., add a new table like Profile
), then run:
npm run schema-migrate:dev dev
Edit SQL files under ./data
, then run:
npm run data-migrate:dev
After development:
# Migrate schema to test
npm run schema-migrate:test deploy
# Migrate data to test
npm run data-migrate:test
Update schema/root.prisma
with a provider and configure the DB_URL
in .env.*
.
Examples:
provider = "postgresql"
DB_URL="postgresql://user:pass@localhost:5432/db?schema=public"
provider = "mysql"
DB_URL="mysql://user:pass@localhost:3306/db"
provider = "sqlserver"
DB_URL="sqlserver://localhost:1433;initial catalog=db;user=sa;password=pass;"
provider = "mongodb"
DB_URL="mongodb://user:pass@localhost/db?authSource=admin"
- 📘 Read the Docs
- ⭐️ Star the repo if helpful
- 🛠 Contribute or report issues: [email protected]