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

Instruction increment trigger may be broken #141

Closed
mikfire opened this issue Jan 22, 2016 · 3 comments
Closed

Instruction increment trigger may be broken #141

mikfire opened this issue Jan 22, 2016 · 3 comments

Comments

@mikfire
Copy link
Contributor

mikfire commented Jan 22, 2016

I think there's a bug in the database triggers. The auto increment trigger looks like this:

  CREATE TRIGGER inc_ins_num AFTER INSERT ON instruction_in_recipe
  BEGIN
     UPDATE instruction_in_recipe SET instruction_number =
        (SELECT max(instruction_number) FROM instruction_in_recipe WHERE recipe_id = new.recipe_id) + 1
        WHERE rowid = new.rowid;
  END;

I suspect the problem is that there is no column named "rowid". I have no idea if there is an impact from this. I am deep in an interesting idea, or I would otherwise stop and fix it myself.

@rocketman768
Copy link
Member

It would be weird if this were not a bug. I'm pretty sure everything in the database is keyed by a field named "id".

@ghost
Copy link

ghost commented Feb 11, 2016

In sqlite3 rowid is a special column and is always created by default and doesn't show with .schema command.

@mikfire
Copy link
Contributor Author

mikfire commented May 25, 2016

This seems to be working as expected. I will close the bug.

@mikfire mikfire closed this as completed May 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants