Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add bigint #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 => "bigint"
case TypeIdentifier.Float => "Decimal(65,30)"
case TypeIdentifier.Cuid => "varchar (25)"
case TypeIdentifier.Enum => "text"
Expand Down