Skip to content

Commit 28eca51

Browse files
authored
fix(server): file_type column migration integrity error (#941)
Signed-off-by: Radek Ježek <[email protected]>
1 parent 625f255 commit 28eca51

File tree

2 files changed

+12
-2
lines changed
  • apps
    • beeai-cli/src/beeai_cli/commands
    • beeai-server/src/beeai_server/infrastructure/persistence/migrations/alembic/versions

2 files changed

+12
-2
lines changed

apps/beeai-cli/src/beeai_cli/commands/platform.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,14 @@ async def start(
305305
elif status != "running":
306306
await run_command(
307307
{
308-
VMDriver.lima: [_limactl_exe(), "--tty=false", "start", "--memory=8", vm_name],
308+
VMDriver.lima: [
309+
_limactl_exe(),
310+
"--tty=false",
311+
"start",
312+
"--memory=8",
313+
"--mount=/tmp/beeai:w",
314+
vm_name,
315+
],
309316
VMDriver.wsl: ["wsl.exe", "--user", "root", "--distribution", vm_name, "dbus-launch", "true"],
310317
}[_vm_driver()],
311318
"Starting up",

apps/beeai-server/src/beeai_server/infrastructure/persistence/migrations/alembic/versions/8b2065340855_.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ def upgrade() -> None:
4646
sa.UniqueConstraint("file_id"),
4747
)
4848
file_type_enum.create(op.get_bind())
49-
op.add_column("files", sa.Column("file_type", file_type_enum, nullable=False))
49+
op.add_column("files", sa.Column("file_type", file_type_enum, nullable=True))
50+
op.execute("UPDATE files SET file_type = 'user_upload'")
51+
op.alter_column("files", "file_type", nullable=False)
52+
5053
op.add_column("files", sa.Column("parent_file_id", sa.UUID(), nullable=True))
5154
op.create_foreign_key(None, "files", "files", ["parent_file_id"], ["id"], ondelete="CASCADE")
5255
# ### end Alembic commands ###

0 commit comments

Comments
 (0)