datasource db {
provider = "mysql"
url = "mysql://root:xxx@localhost:3306/rbac"
}
# or
datasource db {
provider = "mysql"
url = env("DB_URL")
}
datasource db {
provider = "mysql"
url = "mysql://root:xxx@localhost:3306/rbac"
}
model Role {
code String @id
name String
}
model User {
uid String @id
name String
}
model Permission {
id Int @id @default(autoincrement())
name String @unique
operationPath String @unique
operationId BigInt @unique
}
model post {
id Int @id @default(autoincrement())
content String
cate String
}
datasource db {
provider = "mysql"
url = "mysql://root:xxx@localhost:3306/rbac"
}
model Role {
code String @id
name String
Permission Permission[] #增加外键关联
User User[] #增加外键关联
}
model User {
uid String @id
name String
Role Role[] #增加外键关联
}
model Permission {
id Int @id @default(autoincrement())
name String @unique
operationPath String @unique
operationId BigInt @unique
Role Role[] #增加外键关联
}
# 删除post表