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

UNIQUE constraint failed: books.name #9

Open
hackmeister opened this issue Apr 22, 2017 · 3 comments
Open

UNIQUE constraint failed: books.name #9

hackmeister opened this issue Apr 22, 2017 · 3 comments
Assignees
Labels

Comments

@hackmeister
Copy link

I just started getting this error from the following command:
qnote edit book daily

@anmil anmil added the bug label Apr 22, 2017
@anmil anmil self-assigned this Apr 22, 2017
@anmil
Copy link
Owner

anmil commented Apr 22, 2017

Appears I'm not checking if the book already exists

run qnote ls books to see if the book "daily" already exists, if so you can't have two books with the same name.

The edit book command is not well documented, the command changes the name of the current working book (default General) to the name given, in your case "daily". If you want to rename a different book. You need to give the -n flag with the book name.

So, if you want to rename a book called "hourly" to "daily"
qnote edit book -n hourly daily

If you want to move all the notes from one book to another existing book. You need to use the merge command

$ qnote merge -h
Merge all of the notes from <book_name 1> into <book_name 2>. Than <book_name 1>
is deleted and <book_name 2> is re-indexed.

Usage:
  qnote merge [flags] <book_name 1> <book_name 2>

Global Flags:
  -n, --notebook string   Working Notebook (default "General")
      --skip-confirm      Do not prompt to confirm action

@hackmeister
Copy link
Author

hackmeister commented Apr 23, 2017 via email

@anmil
Copy link
Owner

anmil commented Apr 24, 2017

The -n flag specifies the book, with "General" being the default

This command will create a new note in the "General" book
qnote new note

This command will create a new note in the "Daily" book
qnote new -n daily note

You can create new books with
qnote new book <book name>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants