question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Handle error `ERROR HY000 (1105): direct DDL is disabled`

See original GitHub issue

PlanetScale or Vitess (with enable_direct_ddl=false) throws the following error if you try to run DDL statements on the main branch, as you are supposed to only run these in branches and deploy them via “deploy requests”:

ERROR HY000 (1105): direct DDL is disabled

To reproduce: Run any DDL statement on a main branch on a PlanetScale database.

We should catch this and output a known error message with the following message text:

Direct execution of DDL (Data Definition Language) SQL statements is disabled on this database. Please read more here how to handle this: https://pris.ly/d/migrate-no-direct-ddl

(The link currently points to a rather general issue, but will be updated to point to a specific issue or documentation later)

The Vitess instances we are testing against do not show this behavior by default, but can be configured to do so via ENABLE_DIRECT_DDL: false in docker-compose.yml.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

6reactions
tomhoulecommented, Jul 6, 2021

@bigint I think this is probably because you are pushing to the main branch. Pushing to any other branch should work. We haven’t implemented special handling for this error yet.

3reactions
janpiocommented, Jul 7, 2021

That depends on how you want to use PlanetScale. You can either do that, but I am not sure if branches get the same guarantees re stability as the main branch. Or you use their branching system and merge the PR changes from the branch where you applied the migration, to your main branch (instead of using migrate deploy as you would in the normal Prisma only workflow).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Branching
You'll see a ERROR 1105 (HY000): direct DDL is disabled message if you attempt to make schema changes in a production branch.
Read more >
python - Why do I get this error when I want to connect ...
Why do I get this error when I want to connect to my database pymysql.err.OperationalError: (1105, 'direct DDL is disabled').
Read more >
Chapter 2, Server Error Message Reference
Error number: 1105 ; Symbol: ER_UNKNOWN_ERROR ; SQLSTATE: HY000 ... Message: The '%s' feature is disabled; you need MySQL built with '%s' to...
Read more >
Troubleshooting for RDS Proxy
To fix this error, do one of the following: Disable the proxy's Require Transport Layer Security option. Connect to the database using the...
Read more >
Error message reference
For more information about how to work with exceptions and error codes, see Handling exceptions and errors. Prisma Client error types.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found