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

Referential actions in the Prisma Schema Language #1947

Merged
merged 57 commits into from Jun 22, 2021
Merged

Commits on Jun 2, 2021

  1. Referential action support for IE, ME and PSL

    Supported actions: `Cascade`, `Restrict`, `NoAction`, `SetNull` and
    `SetDefault`.
    
    Per-database validation, e.g. `Restrict` doesn't validate on SQL Server.
    
    Defaults to:
    
    - `onUpdate`: `SetNull` on optional and `Cascade` on required relations.
    - `onDelete`: `SetNull` on optional and `Restrict` on required relations.
    
    Currently ALWAYS renders the actions on introspection, due to the
    database always has some action set.
    Julius de Bruijn committed Jun 2, 2021
    Configuration menu
    Copy the full SHA
    619733a View commit details
    Browse the repository at this point in the history
  2. Do not render default referential actions

    Julius de Bruijn committed Jun 2, 2021
    Configuration menu
    Copy the full SHA
    18ac766 View commit details
    Browse the repository at this point in the history

Commits on Jun 4, 2021

  1. Remove legacy cascades.

    Mark some places that require work.
    dpetrick committed Jun 4, 2021
    Configuration menu
    Copy the full SHA
    feef5f3 View commit details
    Browse the repository at this point in the history

Commits on Jun 7, 2021

  1. Emulated actions

    Julius de Bruijn committed Jun 7, 2021
    Configuration menu
    Copy the full SHA
    d4b9fc0 View commit details
    Browse the repository at this point in the history
  2. First pass over the graph

    dpetrick committed Jun 7, 2021
    Configuration menu
    Copy the full SHA
    efa606e View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    28634ef View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e6f8c48 View commit details
    Browse the repository at this point in the history
  5. Default virtual actions

    Julius de Bruijn committed Jun 7, 2021
    Configuration menu
    Copy the full SHA
    1f3bc2c View commit details
    Browse the repository at this point in the history
  6. Working db propagation.

    dpetrick committed Jun 7, 2021
    Configuration menu
    Copy the full SHA
    9e6ea45 View commit details
    Browse the repository at this point in the history
  7. Add new prisma-fmt command referential-actions

    Call it with starting prisma-fmt with subcommand referential actions.
    STDIN takes the data model and stdout lists all allowed actions.
    Julius de Bruijn committed Jun 7, 2021
    Configuration menu
    Copy the full SHA
    a4032c5 View commit details
    Browse the repository at this point in the history

Commits on Jun 8, 2021

  1. Get the default actions from dml (if possible)

    Julius de Bruijn committed Jun 8, 2021
    Configuration menu
    Copy the full SHA
    4f4f04f View commit details
    Browse the repository at this point in the history
  2. onUpdate should always CASCADE.

    Julius de Bruijn committed Jun 8, 2021
    Configuration menu
    Copy the full SHA
    7bef40a View commit details
    Browse the repository at this point in the history

Commits on Jun 9, 2021

  1. Minor schema fix for update

    dpetrick committed Jun 9, 2021
    Configuration menu
    Copy the full SHA
    ecf9b5b View commit details
    Browse the repository at this point in the history
  2. Core graph debugging

    dpetrick committed Jun 9, 2021
    Configuration menu
    Copy the full SHA
    7eaaaf0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a73614f View commit details
    Browse the repository at this point in the history
  4. Merge branch 'master' into referential-actions

    Julius de Bruijn committed Jun 9, 2021
    Configuration menu
    Copy the full SHA
    4054aba View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    af5b0fa View commit details
    Browse the repository at this point in the history
  6. Emulation defaults

    dpetrick committed Jun 9, 2021
    Configuration menu
    Copy the full SHA
    eb2ff28 View commit details
    Browse the repository at this point in the history

Commits on Jun 11, 2021

  1. No virtuals, foreign key capability, validations

    Julius de Bruijn committed Jun 11, 2021
    Configuration menu
    Copy the full SHA
    bf26779 View commit details
    Browse the repository at this point in the history
  2. Add test for onUpdate on the wrong side

    Julius de Bruijn committed Jun 11, 2021
    Configuration menu
    Copy the full SHA
    486e285 View commit details
    Browse the repository at this point in the history
  3. First tests for onDelete

    dpetrick committed Jun 11, 2021
    Configuration menu
    Copy the full SHA
    40cd6b2 View commit details
    Browse the repository at this point in the history

Commits on Jun 14, 2021

  1. Missing onDelete mode tests

    dpetrick committed Jun 14, 2021
    Configuration menu
    Copy the full SHA
    a824868 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    b7d7858 View commit details
    Browse the repository at this point in the history
  3. Disable emulation correctly.

    dpetrick committed Jun 14, 2021
    Configuration menu
    Copy the full SHA
    63f2fa8 View commit details
    Browse the repository at this point in the history
  4. Clippy.

    Bug.
    dpetrick committed Jun 14, 2021
    Configuration menu
    Copy the full SHA
    ae2f024 View commit details
    Browse the repository at this point in the history
  5. Fix test_suite macro

    dpetrick committed Jun 14, 2021
    Configuration menu
    Copy the full SHA
    912d03b View commit details
    Browse the repository at this point in the history
  6. Ignore SetDefault for MySQL

    dpetrick committed Jun 14, 2021
    Configuration menu
    Copy the full SHA
    74b9cd8 View commit details
    Browse the repository at this point in the history

Commits on Jun 15, 2021

  1. Configuration menu
    Copy the full SHA
    21308fb View commit details
    Browse the repository at this point in the history

Commits on Jun 16, 2021

  1. Skeleton work

    dpetrick committed Jun 16, 2021
    Configuration menu
    Copy the full SHA
    065e991 View commit details
    Browse the repository at this point in the history

Commits on Jun 17, 2021

  1. Feature-gating referential actions for IE/ME

    Julius de Bruijn committed Jun 17, 2021
    Configuration menu
    Copy the full SHA
    a28c9ef View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    15acaff View commit details
    Browse the repository at this point in the history
  3. Clippy.

    Ignore SetDefault tests for MySQL
    dpetrick committed Jun 17, 2021
    Configuration menu
    Copy the full SHA
    da6661d View commit details
    Browse the repository at this point in the history
  4. Add cascade onUpdate spec

    dpetrick committed Jun 17, 2021
    Configuration menu
    Copy the full SHA
    00ec7c1 View commit details
    Browse the repository at this point in the history

Commits on Jun 18, 2021

  1. Green IE/PSL tests

    Julius de Bruijn committed Jun 18, 2021
    Configuration menu
    Copy the full SHA
    b0b337a View commit details
    Browse the repository at this point in the history
  2. WIP: Fixing ME tests

    TODO: a way to pass RA preview flag correctly (everywhere)
    Julius de Bruijn committed Jun 18, 2021
    Configuration menu
    Copy the full SHA
    adcc20b View commit details
    Browse the repository at this point in the history
  3. onUpdate tests

    dpetrick committed Jun 18, 2021
    Configuration menu
    Copy the full SHA
    2d8e33f View commit details
    Browse the repository at this point in the history
  4. Merge branch 'referential-actions' of github.com:prisma/prisma-engine…

    … into referential-actions
    dpetrick committed Jun 18, 2021
    Configuration menu
    Copy the full SHA
    f93151a View commit details
    Browse the repository at this point in the history

Commits on Jun 19, 2021

  1. Setting up

    dpetrick committed Jun 19, 2021
    Configuration menu
    Copy the full SHA
    4b1bbff View commit details
    Browse the repository at this point in the history

Commits on Jun 21, 2021

  1. Add preview_features test params for ME

    Julius de Bruijn committed Jun 21, 2021
    Configuration menu
    Copy the full SHA
    3c4c400 View commit details
    Browse the repository at this point in the history
  2. onUpdate work.

    dpetrick committed Jun 21, 2021
    Configuration menu
    Copy the full SHA
    06c16b2 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    d3f0ee4 View commit details
    Browse the repository at this point in the history
  4. Compilation

    dpetrick committed Jun 21, 2021
    Configuration menu
    Copy the full SHA
    ea7a010 View commit details
    Browse the repository at this point in the history
  5. Merge branch 'master' into referential-actions

    Julius de Bruijn committed Jun 21, 2021
    Configuration menu
    Copy the full SHA
    0ba0965 View commit details
    Browse the repository at this point in the history
  6. IE/ME clippy

    Julius de Bruijn committed Jun 21, 2021
    Configuration menu
    Copy the full SHA
    68badc9 View commit details
    Browse the repository at this point in the history
  7. Do not patch barrel

    Julius de Bruijn committed Jun 21, 2021
    Configuration menu
    Copy the full SHA
    357ce5c View commit details
    Browse the repository at this point in the history
  8. More clippy

    Julius de Bruijn committed Jun 21, 2021
    Configuration menu
    Copy the full SHA
    67a4939 View commit details
    Browse the repository at this point in the history
  9. Make legacy compound defaults work again

    Julius de Bruijn committed Jun 21, 2021
    Configuration menu
    Copy the full SHA
    d526152 View commit details
    Browse the repository at this point in the history

Commits on Jun 22, 2021

  1. Set referential action for compounds correctly

    If even one underlying scalar field is required, the default referential
    action should not be `SetNull`.
    Julius de Bruijn committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    7931c4c View commit details
    Browse the repository at this point in the history
  2. Merge branch 'master' into referential-actions

    Julius de Bruijn committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    1926d49 View commit details
    Browse the repository at this point in the history
  3. Nyeh nyeh test fix

    Julius de Bruijn committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    b5bd2f1 View commit details
    Browse the repository at this point in the history
  4. LAST BROKEN TESTS

    Julius de Bruijn committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    d1b654c View commit details
    Browse the repository at this point in the history
  5. LAST LAST BROKEN TESTS

    Julius de Bruijn committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    ed65a0e View commit details
    Browse the repository at this point in the history
  6. Merge branch 'master' into referential-actions

    Julius de Bruijn committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    1cc068d View commit details
    Browse the repository at this point in the history
  7. First round of review fixes

    Julius de Bruijn committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    de24f6b View commit details
    Browse the repository at this point in the history
  8. Rename variable

    Julius de Bruijn committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    288f969 View commit details
    Browse the repository at this point in the history
  9. Clone -> cloned

    Julius de Bruijn committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    ea849b2 View commit details
    Browse the repository at this point in the history
  10. Validation error if ref actions on both sides

    Julius de Bruijn committed Jun 22, 2021
    Configuration menu
    Copy the full SHA
    de3b045 View commit details
    Browse the repository at this point in the history