v1.0 - Version stable: multi-PC, détection UI-DETR-1, 3 modes exécution
- Frontend v4 accessible sur réseau local (192.168.1.40) - Ports ouverts: 3002 (frontend), 5001 (backend), 5004 (dashboard) - Ollama GPU fonctionnel - Self-healing interactif - Dashboard confiance Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,7 @@ from flask import Flask
|
||||
from flask_cors import CORS
|
||||
from flask_socketio import SocketIO
|
||||
from flask_caching import Cache
|
||||
from flask_migrate import Migrate
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
|
||||
@@ -30,6 +31,10 @@ app.config['CACHE_REDIS_URL'] = os.getenv('REDIS_URL', 'redis://localhost:6379/0
|
||||
# Initialize extensions - Use db from v3 models (source of truth)
|
||||
from db.models import db
|
||||
db.init_app(app)
|
||||
|
||||
# Initialize Flask-Migrate for database migrations
|
||||
migrate = Migrate(app, db)
|
||||
|
||||
cache = Cache(app)
|
||||
socketio = SocketIO(
|
||||
app,
|
||||
@@ -287,9 +292,23 @@ def execute_workflow_step():
|
||||
'error': str(e)
|
||||
}), 500
|
||||
|
||||
# Create database tables
|
||||
# Create database tables - only if migrations not available
|
||||
# In production, use: flask db upgrade
|
||||
import os
|
||||
migrations_dir = os.path.join(os.path.dirname(__file__), 'migrations')
|
||||
with app.app_context():
|
||||
db.create_all()
|
||||
if not os.path.exists(migrations_dir):
|
||||
# No migrations folder - use create_all for development
|
||||
db.create_all()
|
||||
print("✅ [DB] Tables créées avec db.create_all()")
|
||||
else:
|
||||
# Migrations available - check if alembic_version exists
|
||||
from sqlalchemy import inspect
|
||||
inspector = inspect(db.engine)
|
||||
if 'alembic_version' not in inspector.get_table_names():
|
||||
# First run with migrations - create tables and stamp
|
||||
db.create_all()
|
||||
print("✅ [DB] Tables créées, utiliser 'flask db stamp head' pour initialiser les migrations")
|
||||
|
||||
# Initialize VisualTargetManager with RPA Vision V3 components (optional)
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user