Skip to content

Commit

Permalink
fix(Translation): change datamodel for Translation, Localization, Lan…
Browse files Browse the repository at this point in the history
…guage
  • Loading branch information
nampdn committed May 13, 2019
1 parent 0613fb6 commit ad0f39b
Show file tree
Hide file tree
Showing 3 changed files with 693 additions and 131 deletions.
26 changes: 14 additions & 12 deletions datamodel.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type User {
type Profile {
id: ID! @id
oldId: ID! @unique
fullName: String!
fullName: String!
gender: Boolean!
email: String
facebookId: String
Expand Down Expand Up @@ -112,20 +112,22 @@ type ActivityAttendance {
createdAt: DateTime! @createdAt
}

enum LanguageCode {
VI,
EN
type Language {
id: ID! @id
code: String! @unique
name: String!
translation: [Translation!] @relation(name: "TranslationLanguage")
}

type Translation {
id: ID! @id
lang: LanguageCode!
text: String!
localization: Localization! @relation(name: "LocalizationTranslation")
id: ID! @id
text: String!
language: Language @relation(link: TABLE, name: "TranslationLanguage")
localization: Localization @relation(link: TABLE, name: "TranslationLocalization")
}

type Localization {
id: ID! @id
key: String! @unique
translations: [Translation!]! @relation(link: "TABLE", name: "LocalizationTranslation")
}
id: ID! @id
key: String! @unique
translations: [Translation!] @relation(name: "TranslationLocalization")
}
Loading

0 comments on commit ad0f39b

Please sign in to comment.