You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have created a join table UserAndPrescription connecting User and Prescription, but each time the project starts, this error occurs. Being less familiar with database concepts, I am unsure how to address this issue properly. Here are the details of the Teo framework version I am using:
enviroment:
nodejs: 22.0.0
@teocloud/teo: 0.2.36
error
sqlite connector connected for `main` at "sqlite:medicine.sqlite"
thread 'tokio-runtime-worker' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/teo-sql-connector-0.2.32/src/migration/migrate.rs:202:73:
called `Result::unwrap()` on an `Err` value: Error { kind: QueryError(SqliteFailure(Error { code: Unknown, extended_code: 1 }, Some("object name reserved for internal use: sqlite_autoindex_UserAndPrescription_1"))), original_code: Some("1"), original_message: Some("object name reserved for internal use: sqlite_autoindex_UserAndPrescription_1") }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
code
connector {
provider: .sqlite,
url: "sqlite:medicine.sqlite"
}
server {
bind:("0.0.0.0", 8088)
}
model User{
@id @autoIncrement @readonly
id: Int
name: String
@relation(through:UserAndPrescription, local: .user, foreign: .prescription)
prescriptions: Prescription[]
}
model Prescription{
@id @autoIncrement @readonly
id: Int
title: String
note: String?
start_date: Int
end_date: Int?
@relation(through:UserAndPrescription, local: .prescription, foreign: .user)
users: User[]
}
@id([.userId, .prescriptionId])
model UserAndPrescription{
@foreignKey
userId: Int
@foreignKey
prescriptionId: Int
@relation(fields: .userId, references: .id)
user: User
@relation(fields: .prescriptionId, references: .id)
prescription: Prescription
}
The text was updated successfully, but these errors were encountered:
I have created a join table
UserAndPrescription
connectingUser
andPrescription
, but each time the project starts, this error occurs. Being less familiar with database concepts, I am unsure how to address this issue properly. Here are the details of the Teo framework version I am using:enviroment:
nodejs: 22.0.0
@teocloud/teo: 0.2.36
error
code
The text was updated successfully, but these errors were encountered: