Coder Social home page Coder Social logo

Comments (4)

Odonno avatar Odonno commented on May 31, 2024

Hi Stephan

This error seems to happen when your migration file is empty, see https://github.com/surrealdb/surrealdb/blob/main/lib/src/err/mod.rs#L78

Can you share a reproducible example so I can see what is wrong.

If your .surql file is indeed empty, you can safely remove it and the error should go away.

from surrealdb-migrations.

unidesigner avatar unidesigner commented on May 31, 2024

Hi David

The migration are not empty, so there must be another reason. Here is the folder with the files.

term2.tar.gz

With the following code

$ surrealdb-migrations apply --address ws://localhost:8000 --ns test --db term2 --username root --password root 
Executing migration AddPost...
Schema files successfully executed!
Migration files successfully executed!
$ surrealdb-migrations apply --down 0 --address ws://localhost:8000 --ns test --db term2 --username root --password root 
Error: Specify some SQL code to execute

using

surrealdb-migrations 0.9.10
surreal: 1.0.0-beta.9+20230402.5eafebd for linux on x86_64

Thanks for help!

from surrealdb-migrations.

Odonno avatar Odonno commented on May 31, 2024

Ok, this is my mistake. BTW, thanks for sharing this reproducible example!

When applying revert (on rollback migrations), I parse the schemas and events statements to detect the difference between them in order to correctly rollback to the previous database schema. However, parsing empty string (without any statement) fails miserably. When you have a migration project without event, it then fails for this reason.

I am now releasing the v0.9.11 which will fix this error.

Thank you for reporting this error.

from surrealdb-migrations.

unidesigner avatar unidesigner commented on May 31, 2024

This works now! Thanks a lot for the quick response, fix and this useful tool. I hope you will continue developing it.

from surrealdb-migrations.

Related Issues (20)

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.