mirror of
https://github.com/chaitin/MonkeyCode.git
synced 2026-02-03 15:23:30 +08:00
Merge pull request #288 from Haydenkkk/fix/filename-2long
fix: update workspace_files path column to support larger sizes
This commit is contained in:
@@ -762,7 +762,7 @@ var (
|
||||
// WorkspaceFilesColumns holds the columns for the "workspace_files" table.
|
||||
WorkspaceFilesColumns = []*schema.Column{
|
||||
{Name: "id", Type: field.TypeUUID},
|
||||
{Name: "path", Type: field.TypeString},
|
||||
{Name: "path", Type: field.TypeString, Size: 2147483647},
|
||||
{Name: "content", Type: field.TypeString, Nullable: true, Size: 2147483647},
|
||||
{Name: "hash", Type: field.TypeString},
|
||||
{Name: "language", Type: field.TypeString, Nullable: true},
|
||||
|
||||
@@ -32,7 +32,7 @@ func (WorkspaceFile) Fields() []ent.Field {
|
||||
field.UUID("id", uuid.UUID{}),
|
||||
field.UUID("user_id", uuid.UUID{}).Comment("关联的用户ID"),
|
||||
field.UUID("workspace_id", uuid.UUID{}).Comment("关联的工作区ID"),
|
||||
field.String("path").Validate(func(s string) error {
|
||||
field.Text("path").Validate(func(s string) error {
|
||||
if s == "" {
|
||||
return fmt.Errorf("path cannot be empty")
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
-- Alter workspace_files table to change path column from TEXT to VARCHAR(255)
|
||||
-- Note: This operation may fail if any existing path values exceed 255 characters
|
||||
ALTER TABLE workspace_files
|
||||
ALTER COLUMN path TYPE VARCHAR(255);
|
||||
@@ -0,0 +1,3 @@
|
||||
-- Alter workspace_files table to change path column from VARCHAR(255) to TEXT
|
||||
ALTER TABLE workspace_files
|
||||
ALTER COLUMN path TYPE TEXT;
|
||||
Reference in New Issue
Block a user