opened
pantharshit00
username_0
<!-- 
Thanks for helping us improve Prisma! 🙏 Please follow the sections in the template and provide as much information as possible about your problem, e.g. by setting the `DEBUG="*"` environment variable and enabling additional logging output in Prisma Client.

Learn more about writing proper bug reports here: https://pris.ly/d/bug-reports
--> 

## Bug description
Right now prisma migrate is able to use enums on sqlite and it maps the specific field to text. 

![image](https://user-images.githubusercontent.com/22195362/77322361-a1014580-6d39-11ea-89a7-5a79d5cfc524.png)

We used to shim enum behaviour via join table but this behaviour got removed as we now favour native database features.

## How to reproduce
1. Try migrating the following schema
```prisma
datasource db {
  provider = "sqlite"
  url      = "file:dev.db" 
}

generator client {
  provider = "prisma-client-js"
}

model User {
  id        String    @default(cuid()) @id
  email     String    @unique
  password  String
  createdAt DateTime? @default(now())
  updatedAt DateTime? @updatedAt
  firstName String
  lastName  String
  role      Role
}

enum Role {
 USER ADMIN
}

```

2. Inspect the table and see the column for `role`. It is mapped to a `TEXT` with a default value of USER.

## Expected behavior
Since enums are not supported in sqlite, prisma migrate should not create the table and should throw a known error.

## Environment & setup
<!-- In which environment does the problem occur -->

- OS: MacOS 10.15.2
- Database: Sqlite 3.27.2(this ships with the prisma migrate cli)
- Prisma version: `prisma2@2.0.0-preview024, binary version: 377df4fe30aa992f13f1ba152cf83d5770bdbc85`
- Node.js version: 12.15.0
Migrate allows you to use enums in sqlite even though sqlite doesn't support them
issue
created
tomhoule
username_1
Internal note: This is a schema validation issue, not a migration engine issue. I will tackle it anyway if it's not too involved and get it reviewed.
comment
created
mavilein
username_2
fixed in: https://github.com/prisma/prisma-engines/pull/673
comment
closed
mavilein
username_2
issue