Skip to content

Commit

Permalink
remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
iandyh committed Feb 2, 2024
1 parent b6a423e commit d807e7e
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions shibuya/model/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,43 +161,3 @@ func (p *Project) GetPlans() ([]*Plan, error) {
}
return r, nil
}

func GetProjectsBySid(sid string) ([]*Project, error) {
db := config.SC.DBC
r := []*Project{}
query := fmt.Sprintf("select id, name, owner, sid, created_time from project where sid=%s", sid)
q, err := db.Prepare(query)
if err != nil {
return r, err
}
defer q.Close()
rows, err := q.Query()
if err != nil {
return r, err
}
defer rows.Close()
for rows.Next() {
p := new(Project)
rows.Scan(&p.ID, &p.Name, &p.Owner, &p.SID, &p.CreatedTime)
r = append(r, p)
}
err = rows.Err()
if err != nil {
return r, err
}
return r, nil
}

func (p *Project) UpdateSid(sid string) error {
db := config.SC.DBC
q, err := db.Prepare("update project set sid=? where id=?")
if err != nil {
return err
}
defer q.Close()

if _, err := q.Exec(sid, p.ID); err != nil {
return err
}
return nil
}

0 comments on commit d807e7e

Please sign in to comment.