Skip to content

Instantly share code, notes, and snippets.

@nikolasburk
Last active November 28, 2019 13:21

Revisions

  1. nikolasburk revised this gist Nov 28, 2019. 1 changed file with 6 additions and 2 deletions.
    8 changes: 6 additions & 2 deletions challenge-test.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,8 @@
    # Test

    ## 1
    ## Challenge 1

    Setup instructions:

    ```
    git clone https://github.com/prisma/support-challenges
    @@ -26,7 +28,9 @@ stack backtrace:
    4: std::panicking::default_hook
    ```

    ## 2
    ## Challenge 2

    Setup instructions:

    ```
    cd ../challenge-2
  2. nikolasburk created this gist Nov 28, 2019.
    67 changes: 67 additions & 0 deletions challenge-test.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,67 @@
    # Test

    ## 1

    ```
    git clone https://github.com/prisma/support-challenges
    cd support-challenges/challenge-1
    # Create local Postgres DB called "test1"
    psql test1 < ./db/mysql1.sql
    # Set `datasource` URL in Prisma schema to connect to `test1` DB
    npm install
    npx prisma2 dev
    ```

    This should throw this error:

    ```
    $ npx prisma2 dev
    Error in migration engine: [2019-11-25T10:23:33Z INFO quaint::pool] Starting a PostgreSQL pool with 9 connections.
    thread 'tokio-runtime-worker-0' panicked at 'Error parsing the migration steps: Error("unknown field `name`, expected `model`", line: 1, column: 59)', src/libcore/result.rs:1165:5
    stack backtrace:
    0: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
    1: core::fmt::write
    2: std::io::Write::write_fmt
    3: std::panicking::default_hook::{{closure}}
    4: std::panicking::default_hook
    ```

    ## 2

    ```
    cd ../challenge-2
    # Create local Postgres DB called "test2"
    psql test2 < ./db/mysql2.sql
    # Set `datasource` URL in Prisma schema to connect to `test2` DB
    npm install
    npm run dev
    ```

    This should throw this error:

    ```
    $ yarn dev
    yarn run v1.19.1
    $ ts-node src/index.ts
    /Users/nikolasburk/Desktop/css-hiring-challenge/challenge-2/node_modules/ts-node/src/index.ts:293
    return new TSError(diagnosticText, diagnosticCodes)
    ^
    TSError: ⨯ Unable to compile TypeScript:
    src/index.ts:1:24 - error TS2307: Cannot find module '@generated/photon'.
    1 import { Photon } from '@generated/photon'
    ~~~~~~~~~~~~~~~~~~~
    at createTSError (/Users/nikolasburk/Desktop/css-hiring-challenge/challenge-2/node_modules/ts-node/src/index.ts:293:12)
    at reportTSError (/Users/nikolasburk/Desktop/css-hiring-challenge/challenge-2/node_modules/ts-node/src/index.ts:297:19)
    at getOutput (/Users/nikolasburk/Desktop/css-hiring-challenge/challenge-2/node_modules/ts-node/src/index.ts:399:34)
    at Object.compile (/Users/nikolasburk/Desktop/css-hiring-challenge/challenge-2/node_modules/ts-node/src/index.ts:457:32)
    at Module.m._compile (/Users/nikolasburk/Desktop/css-hiring-challenge/challenge-2/node_modules/ts-node/src/index.ts:530:43)
    at Module._extensions..js (internal/modules/cjs/loader.js:770:10)
    at Object.require.extensions.<computed> [as .ts] (/Users/nikolasburk/Desktop/css-hiring-challenge/challenge-2/node_modules/ts-node/src/index.ts:533:12)
    at Module.load (internal/modules/cjs/loader.js:628:32)
    at Function.Module._load (internal/modules/cjs/loader.js:555:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:822:10)
    error Command failed with exit code 1.
    ```