Skip to content

Commit

Permalink
add RemoteUserPublicKey model
Browse files Browse the repository at this point in the history
  • Loading branch information
juunini committed Oct 26, 2023
1 parent e7def1e commit 0f4b3ef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions models/migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ func Migrate() {
&UserProfile{},
&UserKeyPair{},
&UserInbox{},
&RemoteUserPublicKey{},
)
}
12 changes: 12 additions & 0 deletions models/remote_user_public_key.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package models

import "sample/db"

type RemoteUserPublicKey struct {
ID string `gorm:"primaryKey,type:text"`
PublicKey string `gorm:"not null;type:text"`
}

func (r *RemoteUserPublicKey) GetByID() error {
return db.DB.First(r, "id = ?", r.ID).Error
}

0 comments on commit 0f4b3ef

Please sign in to comment.