mirror of
https://github.com/BradNut/boredgame
synced 2025-09-08 17:40:22 +00:00
Chagne year to db year.
This commit is contained in:
parent
1a8ec5b905
commit
714cdca2e4
2 changed files with 28 additions and 2 deletions
|
|
@ -159,7 +159,7 @@ model Game {
|
||||||
slug String
|
slug String
|
||||||
description String? @db.LongText
|
description String? @db.LongText
|
||||||
description_preview String? @db.LongText
|
description_preview String? @db.LongText
|
||||||
year_published Int?
|
year_published Int? @db.Year
|
||||||
min_players Int?
|
min_players Int?
|
||||||
max_players Int?
|
max_players Int?
|
||||||
min_playtime Int?
|
min_playtime Int?
|
||||||
|
|
@ -195,6 +195,7 @@ model Game {
|
||||||
model GameName {
|
model GameName {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
name String
|
name String
|
||||||
|
slug String
|
||||||
game_id String
|
game_id String
|
||||||
game Game @relation(references: [id], fields: [game_id])
|
game Game @relation(references: [id], fields: [game_id])
|
||||||
created_at DateTime @default(now()) @db.Timestamp(6)
|
created_at DateTime @default(now()) @db.Timestamp(6)
|
||||||
|
|
@ -247,6 +248,7 @@ model Mechanic {
|
||||||
model Designer {
|
model Designer {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
name String
|
name String
|
||||||
|
slug String
|
||||||
external_id String @unique
|
external_id String @unique
|
||||||
games Game[]
|
games Game[]
|
||||||
primary_designer Game[] @relation("PrimaryDesigners")
|
primary_designer Game[] @relation("PrimaryDesigners")
|
||||||
|
|
@ -260,7 +262,7 @@ model Designer {
|
||||||
model Artist {
|
model Artist {
|
||||||
id String @id @default(cuid())
|
id String @id @default(cuid())
|
||||||
name String
|
name String
|
||||||
external_id String @unique
|
slug String @unique
|
||||||
games Game[]
|
games Game[]
|
||||||
created_at DateTime @default(now()) @db.Timestamp(6)
|
created_at DateTime @default(now()) @db.Timestamp(6)
|
||||||
updated_at DateTime @updatedAt @db.Timestamp(6)
|
updated_at DateTime @updatedAt @db.Timestamp(6)
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import { PrismaClient } from '@prisma/client';
|
import { PrismaClient } from '@prisma/client';
|
||||||
import kebabCase from 'just-kebab-case';
|
import kebabCase from 'just-kebab-case';
|
||||||
|
import { createId } from '@paralleldrive/cuid2';
|
||||||
import categories from './categories.json' assert { type: 'json' };
|
import categories from './categories.json' assert { type: 'json' };
|
||||||
import mechanics from './mechanics.json' assert { type: 'json' };
|
import mechanics from './mechanics.json' assert { type: 'json' };
|
||||||
|
|
||||||
|
|
@ -49,6 +50,29 @@ async function main() {
|
||||||
console.log('Categories created.');
|
console.log('Categories created.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await prisma.publisher.create({
|
||||||
|
data: {
|
||||||
|
name: 'Unknown',
|
||||||
|
slug: 'unknown',
|
||||||
|
external_id: createId()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
await prisma.designer.create({
|
||||||
|
data: {
|
||||||
|
name: 'Unknown',
|
||||||
|
slug: 'unknown',
|
||||||
|
external_id: createId()
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
await prisma.artist.create({
|
||||||
|
data: {
|
||||||
|
name: 'Unknown',
|
||||||
|
slug: 'unknown'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// for (const p of userData) {
|
// for (const p of userData) {
|
||||||
// const user = await prisma.user.create({
|
// const user = await prisma.user.create({
|
||||||
// data: {
|
// data: {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue