generate schema, push to db and put some data into both models by studio and then
prisma migrate reset
Environment variables loaded from .env
Prisma schema loaded from prisma/schema.prisma
Datasource "db": CockroachDB database "mydb", schema "public" at "localhost:26257"
✔ Are you sure you want to reset your database? All data will be lost. … yes
Error: P3016
The fallback method for database resets failed, meaning Migrate could not clean up the database entirely. Original error:
db error: ERROR: "Quote" is referenced by foreign key from table "SymbolInfo"
0: sql_migration_connector::best_effort_reset
with namespaces=None
at migration-engine/connectors/sql-migration-connector/src/lib.rs:333
1: migration_core::state::Reset
at migration-engine/core/src/state.rs:425
Expected behavior
It should reset the database
Prisma information
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
generator client {
provider = "prisma-client-js"
binaryTargets = ["native", "darwin-arm64"]
output = "./client"
}
datasource db {
provider = "cockroachdb"
url = env("DATABASE_URL")
}
model Quote {
id BigInt @id @default(autoincrement())
symbol String
market String
source String
type String?
sub_type String?
symbol_info SymbolInfo?
settrade_eod SettradeStockEod[]
@@unique([symbol, market])
}
model SymbolInfo {
id BigInt @id @default(autoincrement())
name_en String?
name_th String?
timezone String?
finnomena_id String?
pair_id BigInt?
jitta_currency String?
jitta_unit String?
quote Quote @relation(fields: [quote_id], references: [id])
quote_id BigInt @unique
}
Bug description
@janpio from #4602 I have got the similar error, using the setup in reproduce section. This is my environment
How to reproduce
cockrochdb setup docker-compose.yml
connection string
generate schema, push to db and put some data into both models by studio and then
Expected behavior
It should reset the database
Prisma information
Environment & setup
Prisma Version