Skip to content

Commit a7ff58a

Browse files
Add bigint
1 parent 9e17a01 commit a7ff58a

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

cli/packages/prisma-datamodel/src/datamodel/scalar.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
export type TypeIdentifier =
22
| 'String'
33
| 'Int'
4+
| 'BigInt'
45
| 'Float'
56
| 'Boolean'
67
| 'Long' // Long is sometimes used internally by prisma.
@@ -12,6 +13,7 @@ export type TypeIdentifier =
1213
export abstract class TypeIdentifiers {
1314
public static string: TypeIdentifier = 'String'
1415
public static integer: TypeIdentifier = 'Int'
16+
public static bigInt: TypeIdentifier = 'BigInt'
1517
public static float: TypeIdentifier = 'Float'
1618
public static boolean: TypeIdentifier = 'Boolean'
1719
public static long: TypeIdentifier = 'Long'
@@ -25,6 +27,7 @@ export const TypeIdentifierTable = {
2527
String: true,
2628
Int: true,
2729
Float: true,
30+
BigInt: true,
2831
Boolean: true,
2932
Long: true,
3033
DateTime: true,

cli/packages/prisma-db-introspection/src/databases/relational/mysql/mysqlIntrospectionResult.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,10 @@ export class MysqlIntrospectionResult extends RelationalIntrospectionResult {
4747

4848
switch (type) {
4949
case 'int':
50-
case 'bigint':
5150
case 'smallint':
5251
return TypeIdentifiers.integer
52+
case 'bigint':
53+
return TypeIdentifiers.bigInt
5354
case 'decimal':
5455
case 'float':
5556
case 'double':

server/connectors/deploy-connector-postgres/src/main/scala/com/prisma/deploy/connector/postgres/database/PostgresTypeMapper.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ case class PostgresTypeMapper() extends TypeMapper {
2424
case TypeIdentifier.String => "text"
2525
case TypeIdentifier.Boolean => "boolean"
2626
case TypeIdentifier.Int => "int"
27+
case TypeIdentifier.BigInt => "b
2728
case TypeIdentifier.Float => "Decimal(65,30)"
2829
case TypeIdentifier.Cuid => "varchar (25)"
2930
case TypeIdentifier.Enum => "text"

0 commit comments

Comments
 (0)