Files
flow/scripts/test_with_database.py
T
zeekay eb4fc3b925 rebrand: rename internal package langflow/hanzoflow -> flow
Single generic package name for white-label compatibility.

- git mv src/backend/base/hanzoflow/ -> src/backend/base/flow/
- git rm src/backend/base/langflow/ (compat shim, no longer needed)
- git mv src/backend/hanzoflow/ -> src/backend/flow/ (root package)
- Rename langflow_launcher.py -> launcher.py
- Update all Python imports: from langflow/hanzoflow -> from flow
- Update all string module references in mock targets, JSON data files
- Update pyproject.toml entry points, hatch build targets, mypy/codeflash config
- Update Dockerfile, Makefile, compose files, CI workflows, codecov.yml
- Rename internal classes: HanzoflowApplication -> FlowApplication, etc.
- Update alembic.ini database name
- Keep PyPI package names (hanzoflow, langflow-base) unchanged
- Keep LANGFLOW_* env var names for backwards compatibility
2026-03-25 02:34:37 -07:00

49 lines
1.3 KiB
Python

"""Test migrations with actual database."""
import sqlite3
import tempfile
from alembic import command
from alembic.config import Config
def test_real_migration():
"""Test migration with actual SQLite database."""
# Create temporary database
with tempfile.NamedTemporaryFile(suffix=".db") as tmp:
db_path = tmp.name
# Create test table
conn = sqlite3.connect(db_path)
conn.execute("""
CREATE TABLE users (
id INTEGER PRIMARY KEY,
name TEXT,
old_email TEXT
)
""")
conn.commit()
# Create alembic.ini
alembic_cfg = Config()
alembic_cfg.set_main_option("script_location", "src/backend/base/flow/alembic")
alembic_cfg.set_main_option("sqlalchemy.url", f"sqlite:///{db_path}")
# Run migration
try:
command.upgrade(alembic_cfg, "head")
print("✅ Migration executed successfully")
except RuntimeError as e:
print(f"❌ Migration failed: {e}")
# Verify schema
cursor = conn.execute("PRAGMA table_info(users)")
columns = [row[1] for row in cursor.fetchall()]
print(f"Columns after migration: {columns}")
conn.close()
if __name__ == "__main__":
test_real_migration()