`issues.parent_issue_id` should be null rather than empty string if not exists
Description
I noticed that issues.parent_issue_id is now an empty string if not exists. I think it is more reasonable to be null as it's a nullable field.
Additional context

Hey @warren830, I would like to work on this feature. Could you please assign it to me ?
Here you are, happy coding
This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs.
Any updates? @ppborah
Apologies for the delay @narrowizard, but I am working on it
This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs.
Is it possible to attach the Hactoberfest label ?
@ppborah Done
This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs.
@shubham-cmyk, would you like to take this ?
Can I pick this up?
Please go ahead @deepto98 :)
@deepto98 Thanks, happy coding
Hello @klesh , is this issue still open? I want to work on this.
Hi @deepto98, how is it going on?
@mindlesscloud I'll give this a try today, will let you know
@mindlesscloud @ppborah I forked this repo and am trying to setup the dev environment, by following the steps here: https://devlake.apache.org/docs/DeveloperManuals/DeveloperSetup/. In step 7, when I run make dev, I'm getting an error. Can you please help with this? The error:
...
go run main.go
Version: dev
time="2023-01-07 03:44:08" level=info msg="migration initialized"
time="2023-01-07 03:44:08" level=info msg="plugin loaded ae"
time="2023-01-07 03:44:08" level=info msg="plugin loaded azure"
time="2023-01-07 03:44:08" level=info msg="plugin loaded bitbucket"
time="2023-01-07 03:44:08" level=info msg="plugin loaded customize"
time="2023-01-07 03:44:08" level=info msg="plugin loaded dbt"
time="2023-01-07 03:44:08" level=info msg="plugin loaded dora"
time="2023-01-07 03:44:08" level=info msg="plugin loaded feishu"
time="2023-01-07 03:44:08" level=info msg="plugin loaded gitee"
panic: plugin.Open("bin/plugins/gitextractor/gitextractor.so"): libgit2.so.1.3: cannot open shared object file: No such file or directory
Wraps: (2) plugin.Open("bin/plugins/gitextractor/gitextractor.so"): libgit2.so.1.3: cannot open shared object file: No such file or directory
Error types: (1) *hintdetail.withDetail (2) *errors.errorString
goroutine 1 [running]:
github.com/apache/incubator-devlake/services.Init()
/workspaces/incubator-devlake/services/init.go:73 +0x385
github.com/apache/incubator-devlake/api.CreateApiService()
/workspaces/incubator-devlake/api/api.go:51 +0x2e
main.main()
/workspaces/incubator-devlake/main.go:39 +0x7e
exit status 2
make: *** [Makefile:83: run] Error 1
Environment : Github Codespaces, 16-core, 32GB RAM
@deepto98 Seems like libgit2 is missing, please follow this link to install
@klesh Thanks, I think I had set it up, but trying this once more
@deepto98 I see, try the LD_LIBRARY_PATH variable, the path of the libgit2 may vary from OS to OS, try locating the libgit2.so first, and set it to the variable before you launching the devlake
@klesh Oh okay, I got the project running, and am trying to understand the implementation of ticket.Issue. The field parent_issue_id is defined here, where it has type string:
https://github.com/apache/incubator-devlake/blob/ad6d65ecaefbf2d7ca6b705c11dd7a4bf921140d/models/domainlayer/ticket/issue.go#L43 . I think the issue is persisted from here:
https://github.com/apache/incubator-devlake/blob/ad6d65ecaefbf2d7ca6b705c11dd7a4bf921140d/plugins/webhook/api/issue.go#L156-L160
If we are to truncate empty strings to null, I found this type https://pkg.go.dev/database/sql#NullString, which can be used. However, it would probably affect the existing rows too. Can you help with how it can be implemented? Maybe the type has to be truncated to NULL, when the rows are fetched for the SELECT query, instead of changing the model itself?
You can convert the
ParentIssueId string
gorm:"type:varchar(255)"
to
ParentIssueId *string
gorm:"type:varchar(255)"
Then I think you can make pass the nil
@shubham-cmyk Thanks, will try this.
This issue has been automatically marked as stale because it has not had recent activity for 30 days. It will be closed in next 7 days if no further activity occurs.
This issue has been closed because it has not received response for too long time. You could reopen it if you encountered similar problems in the future.