25 lines
604 B
Python
25 lines
604 B
Python
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",
|
|
)
|