fix: register m0004 add_mentor_note migration
Co-authored-by: multica-agent <github@multica.ai>
This commit is contained in:
co-authored by
multica-agent
parent
e0cba74f8e
commit
0fba71f62c
@@ -0,0 +1,24 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import sqlite3
|
||||
|
||||
from backend.database.migrations.runner import Migration
|
||||
|
||||
|
||||
def add_mentor_note(connection: sqlite3.Connection) -> None:
|
||||
columns = {
|
||||
str(row["name"])
|
||||
for row in connection.execute("PRAGMA table_info(mentor_preferences)")
|
||||
}
|
||||
if "note" not in columns:
|
||||
connection.execute(
|
||||
"ALTER TABLE mentor_preferences ADD COLUMN note TEXT NOT NULL DEFAULT ''"
|
||||
)
|
||||
|
||||
|
||||
MIGRATION = Migration(
|
||||
version="0004",
|
||||
name="add_mentor_note",
|
||||
action=add_mentor_note,
|
||||
signature="mentor-preferences-note:v1:note",
|
||||
)
|
||||
Reference in New Issue
Block a user