fix(build): remove schema from gitignore

This commit is contained in:
diced 2021-08-25 10:01:57 -07:00
parent 2c871be8c5
commit b2be4e51cc
No known key found for this signature in database
GPG key ID: 85AB64C74535D76E
3 changed files with 56 additions and 2 deletions

1
.gitignore vendored
View file

@ -36,6 +36,5 @@ yarn-error.log*
# zipline # zipline
config.toml config.toml
uploads/ uploads/
prisma/schema.prisma
data.db* data.db*
migrations/ migrations/

View file

@ -9,7 +9,7 @@
"build:schema": "prisma generate --schema=prisma/schema.prisma", "build:schema": "prisma generate --schema=prisma/schema.prisma",
"start": "node server", "start": "node server",
"lint": "next lint", "lint": "next lint",
"ts-node": "./node_modules/.bin/ts-node --compiler-options \"{\\\"module\\\":\\\"commonjs\\\"}\" --transpile-only", "ts-node": "ts-node --compiler-options \"{\\\"module\\\":\\\"commonjs\\\"}\" --transpile-only",
"create-all-migrations": "node scripts/create-migrations", "create-all-migrations": "node scripts/create-migrations",
"semantic-release": "semantic-release" "semantic-release": "semantic-release"
}, },

55
prisma/schema.prisma Normal file
View file

@ -0,0 +1,55 @@
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
model User {
id Int @id @default(autoincrement())
username String
password String
token String
administrator Boolean @default(false)
embedTitle String?
embedColor String @default("#2f3136")
images Image[]
urls Url[]
}
model Image {
id Int @id @default(autoincrement())
file String
mimetype String @default("image/png")
created_at DateTime @default(now())
views Int @default(0)
invisible InvisibleImage?
user User @relation(fields: [userId], references: [id])
userId Int
}
model InvisibleImage {
id Int
image Image @relation(fields: [id], references: [id])
invis String @unique
}
model Url {
id Int @id @default(autoincrement())
to String
created_at DateTime @default(now())
views Int @default(0)
invisible InvisibleUrl?
user User @relation(fields: [userId], references: [id])
userId Int
}
model InvisibleUrl {
id Int
url Url @relation(fields: [id], references: [id])
invis String @unique
}