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

SQLITE_ERROR - the database migrations not working #112

Closed
Saibamen opened this issue Jul 25, 2021 · 2 comments
Closed

SQLITE_ERROR - the database migrations not working #112

Saibamen opened this issue Jul 25, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@Saibamen
Copy link
Contributor

Describe the bug

I wanted to test #86 on my localhost, but the migration code are broken, and latest migration was not applied.

[Error: update `monitor` set `name` = 'Monitor with invalid URL', `active` = 1, `user_id` = 1, `interval` = 60, `url` = 'https://wwww', `type` = 'http', `weight` = 2000, `hostname` = NULL, `port` = NULL, `created_date` = 1626651023, `keyword` = NULL, `maxretries` = '1' where `id` = 5 - SQLITE_ERROR: no such column: maxretries] {
  errno: 1,
  code: 'SQLITE_ERROR'
}

Server logs:

Your database version: 0
Latest database version: 1
Database patch is needed
Backup the db
Patching ./db/patch1.sql
Patched ./db/patch1.sql
Database Patched Successfully

Latest database version should be 3 (https://github.com/louislam/uptime-kuma/blob/master/db/patch3.sql).

To Reproduce
Steps to reproduce the behavior:

  1. Go back to commit before merging Implement retries (#56) #86, for example: 5bd3184
  2. Delete database and setup Uptime Kuma
  3. Add Monitor
  4. Pull latest changes from master branch
  5. Update Retries field for Monitor

Expected behavior
No SQLITE_ERROR

Desktop (please complete the following information):

  • Uptime Kuma Version: 1.0.6 dev d556509
  • Using Docker?: No
  • OS: Win 10
  • Browser: ---
@Saibamen Saibamen added the bug Something isn't working label Jul 25, 2021
@louislam
Copy link
Owner

louislam commented Jul 26, 2021

Sorry about that, because I added patch3.sql to master branch before merge the pull request #91 (patch2.sql in here).
You could patch the database manually first if you need development.

@Saibamen
Copy link
Contributor Author

Can we add some warning in Server about it?

For example, if *.sql files != Latest_database_version - display console.warn('Some patches could not be applied. If you are running official release - please create bug report')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants