mirror of
				https://github.com/DerTyp7/explainegy-nextjs.git
				synced 2025-10-30 21:27:12 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			63 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			63 lines
		
	
	
		
			1.8 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| generator client {
 | |
|   provider = "prisma-client-js"
 | |
| }
 | |
| 
 | |
| datasource db {
 | |
|   provider = "postgresql"
 | |
|   url      = env("DATABASE_URL")
 | |
| }
 | |
| 
 | |
| model Article {
 | |
|   id                  Int                 @id @default(autoincrement())
 | |
|   name                String              @unique
 | |
|   title               String              @unique
 | |
|   markdown            String
 | |
|   contentTableEntries ContentTableEntry[]
 | |
|   categoryId          Int
 | |
|   category            Category            @relation(fields: [categoryId], references: [id])
 | |
|   typeId              Int
 | |
|   type                ArticleType         @relation(fields: [typeId], references: [id])
 | |
|   dateCreated         DateTime            @default(now())
 | |
|   dateUpdated         DateTime            @default(now())
 | |
| }
 | |
| 
 | |
| model ContentTableEntry {
 | |
|   id          Int      @id @default(autoincrement())
 | |
|   title       String
 | |
|   anchor      String
 | |
|   orderIndex  Int
 | |
|   articleId   Int
 | |
|   article     Article  @relation(fields: [articleId], references: [id])
 | |
|   dateCreated DateTime @default(now())
 | |
|   dateUpdated DateTime @default(now())
 | |
| }
 | |
| 
 | |
| model Category {
 | |
|   id          Int       @id @default(autoincrement())
 | |
|   name        String    @unique
 | |
|   title       String    @unique
 | |
|   color       String    @unique
 | |
|   svgId       Int
 | |
|   svg         Svg       @relation(fields: [svgId], references: [id])
 | |
|   Article     Article[]
 | |
|   dateCreated DateTime  @default(now())
 | |
|   dateUpdated DateTime  @default(now())
 | |
| }
 | |
| 
 | |
| model ArticleType {
 | |
|   id          Int       @id @default(autoincrement())
 | |
|   name        String    @unique
 | |
|   title       String    @unique
 | |
|   Article     Article[]
 | |
|   dateCreated DateTime  @default(now())
 | |
|   dateUpdated DateTime  @default(now())
 | |
| }
 | |
| 
 | |
| model Svg {
 | |
|   id       Int        @id @default(autoincrement())
 | |
|   name     String     @unique
 | |
|   path     String     @default("")
 | |
|   viewbox  String     @default("0 0 512 512")
 | |
|   Category Category[]
 | |
| }
 |