Skip to content

Commit

Permalink
Add bigint
Browse files Browse the repository at this point in the history
  • Loading branch information
christopherdro committed Mar 19, 2020
1 parent 9e17a01 commit a7ff58a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions cli/packages/prisma-datamodel/src/datamodel/scalar.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
export type TypeIdentifier =
| 'String'
| 'Int'
| 'BigInt'
| 'Float'
| 'Boolean'
| 'Long' // Long is sometimes used internally by prisma.
Expand All @@ -12,6 +13,7 @@ export type TypeIdentifier =
export abstract class TypeIdentifiers {
public static string: TypeIdentifier = 'String'
public static integer: TypeIdentifier = 'Int'
public static bigInt: TypeIdentifier = 'BigInt'
public static float: TypeIdentifier = 'Float'
public static boolean: TypeIdentifier = 'Boolean'
public static long: TypeIdentifier = 'Long'
Expand All @@ -25,6 +27,7 @@ export const TypeIdentifierTable = {
String: true,
Int: true,
Float: true,
BigInt: true,
Boolean: true,
Long: true,
DateTime: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ export class MysqlIntrospectionResult extends RelationalIntrospectionResult {

switch (type) {
case 'int':
case 'bigint':
case 'smallint':
return TypeIdentifiers.integer
case 'bigint':
return TypeIdentifiers.bigInt
case 'decimal':
case 'float':
case 'double':
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ case class PostgresTypeMapper() extends TypeMapper {
case TypeIdentifier.String => "text"
case TypeIdentifier.Boolean => "boolean"
case TypeIdentifier.Int => "int"
case TypeIdentifier.BigInt => "b
case TypeIdentifier.Float => "Decimal(65,30)"
case TypeIdentifier.Cuid => "varchar (25)"
case TypeIdentifier.Enum => "text"
Expand Down

0 comments on commit a7ff58a

Please sign in to comment.