Skip to content

Commit d06be7d

Browse files
QinYuuuuDev Agent
andauthored
enable soft delete for license (#553)
Co-authored-by: Dev Agent <dev-agent@example.com>
1 parent e25103f commit d06be7d

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

builder/store/database/license.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ type License struct {
3636
Extra string `bun:",nullzero" json:"extra"`
3737
Remark string `bun:",nullzero" json:"remark"`
3838
UserUUID string `bun:",notnull" json:"user_uuid"`
39+
DeletedAt time.Time `bun:",soft_delete,nullzero" json:"-"`
3940
times
4041
}
4142

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
SET statement_timeout = 0;
2+
3+
--bun:split
4+
5+
ALTER TABLE licenses DROP COLUMN IF EXISTS deleted_at;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
SET statement_timeout = 0;
2+
3+
--bun:split
4+
5+
ALTER TABLE licenses ADD COLUMN IF NOT EXISTS deleted_at TIMESTAMP;

0 commit comments

Comments
 (0)