Skip to content

add migration for directrun; update feishu model#2030

Merged
klesh merged 4 commits intoapache:mainfrom
merico-ai:issues/2029
Jun 6, 2022
Merged

add migration for directrun; update feishu model#2030
klesh merged 4 commits intoapache:mainfrom
merico-ai:issues/2029

Conversation

@likyh
Copy link
Contributor

@likyh likyh commented May 30, 2022

Summary

copy migrate from services/init.go to directrun.go for migration in cli;

delete id in feishu model and add new primaryKey

Summary 2

I want to keep this PR small, but I got a error when fix feishu model because of time cannot use as primary key.

So Fix it in commit 2.

image
StartTime is a struct so isPrimaryKey not run and StartTime cannot detect as primary key.
origin_img_v2_2bb6a928-3b48-48c8-87c3-1b015f49678g

I fix it like this: check isPrimaryKey before check struct; add need_recursion to avoid unuseful recursion

Does this close any open issues?

close #2029
close #2014
close #2031

Key Points

  • This is a breaking change

@likyh likyh force-pushed the issues/2029 branch 5 times, most recently from 6cfd53f to 9ae8bdc Compare May 31, 2022 01:33
Copy link
Contributor

@klesh klesh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

}

func hasPrimaryKey(ifv reflect.Type) bool {
func hasPrimaryKey(ifv reflect.Type, needRecursion bool) bool {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when do we need this flag? I think it should be always recursive except when primaryKey is found inside gorm tag?

@klesh klesh merged commit 108e393 into apache:main Jun 6, 2022
warren830 pushed a commit to merico-ai/lake that referenced this pull request Jun 6, 2022
* add migration for directrun; update feishu model

* fix: fix primary read bug when time is primary key

* open needRecursion

* delete needRecursion

Co-authored-by: linyh <yanghui@meri.co>
warren830 pushed a commit to merico-ai/lake that referenced this pull request Jun 8, 2022
* add migration for directrun; update feishu model

* fix: fix primary read bug when time is primary key

* open needRecursion

* delete needRecursion

Co-authored-by: linyh <yanghui@meri.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants