d4r1us-drk / clido

A powerful CLI todo list & project manager crafted in Go, designed to keep your tasks and projects organized and accessible right from the terminal
GNU General Public License v3.0
6 stars 1 forks source link

Error creating projects on the new version. #9

Open vhespanha opened 2 months ago

vhespanha commented 2 months ago

Hi!

I was testing the new code for sub-projects and sub-tasks and came across a weird error everytime I tried to create a new project.

The bug:

With some basic investigation I found out what was happening, once you added the new column ParentProjectId to the code, our SQLite instance had a schema change that wasn't migrated, so my current ~/.local/share/clido/data.db contained the old version of that database.

Solution:

As a solution to this, I have two things in mind.

  1. Create a versioning system to the DB and a migration system, so everytime we update the schema, we include that migration on the commit, and whenever a user executes any command on a new version, the tool runs that migration before executing the command itself, fixing any schema mismatches in the process.

  2. Include a develop branch to place the code we're still testing until we cover some use cases, then we merge to main once we hit a new minor version, (or a patch if it's related to a bug)

Implementation

I think I can hack a simple versioning system to the DB and open a PR still today, see you later.

d4r1us-drk commented 2 months ago

Implementing an ORM like gorm would be quite helpful for this purpose

vhespanha commented 2 months ago

Just reverted main to HEAD^ and created the develop branch with the changes from #7 See #12 and #13

Next step is the gorm PR, merge it to develop until we release 1.1

d4r1us-drk commented 2 months ago

Done creating new develop branch

vhespanha commented 2 months ago

#15 will close this!

d4r1us-drk commented 2 months ago

PRs #14 and #15 have been merged, but I will leave this issue opened until it's resolved in the main branch