Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/components/gitpod-db/go/project.go
2497 views
1
// Copyright (c) 2022 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
package db
6
7
import (
8
"database/sql"
9
"time"
10
11
"github.com/google/uuid"
12
"gorm.io/datatypes"
13
)
14
15
type Project struct {
16
ID uuid.UUID `gorm:"primary_key;column:id;type:char;size:36;" json:"id"`
17
Name string `gorm:"column:name;type:varchar;size:255;" json:"name"`
18
CloneURL string `gorm:"column:cloneUrl;type:varchar;size:255;" json:"cloneUrl"`
19
Slug sql.NullString `gorm:"column:slug;type:varchar;size:255;" json:"slug"`
20
Settings datatypes.JSON `gorm:"column:settings;type:text;size:65535;" json:"settings"`
21
22
AppInstallationID string `gorm:"column:appInstallationId;type:varchar;size:255;" json:"appInstallationId"`
23
24
CreationTime VarcharTime `gorm:"column:creationTime;type:varchar;size:255;" json:"creationTime"`
25
LastModified time.Time `gorm:"column:_lastModified;type:timestamp;default:CURRENT_TIMESTAMP(6);" json:"_lastModified"`
26
27
TeamID sql.NullString `gorm:"column:teamId;type:char;size:36;" json:"teamId"`
28
UserID sql.NullString `gorm:"column:userId;type:char;size:36;" json:"userId"`
29
30
MarkedDeleted bool `gorm:"column:markedDeleted;type:tinyint;default:0;" json:"markedDeleted"`
31
}
32
33
// TableName sets the insert table name for this struct type
34
func (d *Project) TableName() string {
35
return "d_b_project"
36
}
37
38