Git Product home page Git Product logo

repro-directus-snapshot-issue's Introduction

Reproducing failed schema apply

This demo reproduces this error:

error: alter table "articles" alter column "id" drop not null - column "id" is in a primary key
    at Parser.parseErrorMessage (/.../node_modules/pg-protocol/dist/parser.js:287:98)
    at Parser.handlePacket (/.../node_modules/pg-protocol/dist/parser.js:126:29)
    at Parser.parse (/.../node_modules/pg-protocol/dist/parser.js:39:38)
    at Socket.<anonymous> (/.../node_modules/pg-protocol/dist/index.js:11:42)
    at Socket.emit (node:events:513:28)
    at addChunk (node:internal/streams/readable:324:12)
    at readableAddChunk (node:internal/streams/readable:297:9)
    at Readable.push (node:internal/streams/readable:234:10)
    at TCP.onStreamRead (node:internal/stream_base_commons:190:23)

Feel free to swap pnpm with yarn or npm.

# Install dependencies
pnpm install

# Setup .env (may need to tweak some settings)
cp .env.example .env

# Bootstrap project
pnpm run bootstrap

# Apply first snapshot
pnpm run schema:apply

# Apply second snapshot and observe error
pnpm run schema:apply_v2

The only difference between the two snapshots are the sort fields. It appears Directus attempts to alter the id column even though the definition has not changed. Since sort is only a visual difference in the Directus UI, one would expect the articles table would not be altered.

repro-directus-snapshot-issue's People

Contributors

smonn avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.