first push
This commit is contained in:
4
backend/database/__init__.py
Normal file
4
backend/database/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
# Database module
|
||||
from database.database import db
|
||||
|
||||
__all__ = ['db']
|
||||
9
backend/database/database.py
Normal file
9
backend/database/database.py
Normal file
@@ -0,0 +1,9 @@
|
||||
from flask_sqlalchemy import SQLAlchemy
|
||||
|
||||
db = SQLAlchemy()
|
||||
|
||||
def init_db(app):
|
||||
"""Initialize database with app context"""
|
||||
db.init_app(app)
|
||||
with app.app_context():
|
||||
db.create_all()
|
||||
12
backend/database/migration_add_image_dimensions.sql
Normal file
12
backend/database/migration_add_image_dimensions.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
-- Migration: Add width and height columns to image table
|
||||
-- Date: 2025-11-27
|
||||
|
||||
USE myapp;
|
||||
|
||||
-- Add width and height columns to image table
|
||||
ALTER TABLE `image`
|
||||
ADD COLUMN `width` FLOAT NULL AFTER `image_path`,
|
||||
ADD COLUMN `height` FLOAT NULL AFTER `width`;
|
||||
|
||||
-- Verify the changes
|
||||
DESCRIBE `image`;
|
||||
Reference in New Issue
Block a user