Remove unused database check scripts for equivalencies and units of measure
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
import sys
|
||||
import os
|
||||
from sqlalchemy import create_engine, text, inspect
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
|
||||
# Add the backend directory to the python path
|
||||
sys.path.append(os.path.join(os.getcwd(), 'backend'))
|
||||
|
||||
from core.config import settings
|
||||
|
||||
def check_equivalencies_columns():
|
||||
engine = create_engine(str(settings.core_database_url))
|
||||
inspector = inspect(engine)
|
||||
|
||||
try:
|
||||
print("Checking equivalencies table columns...")
|
||||
columns = inspector.get_columns('equivalencies', schema='a76')
|
||||
for column in columns:
|
||||
print(f"Column: {column['name']} - Type: {column['type']}")
|
||||
|
||||
print("\nChecking equivalency_items table columns...")
|
||||
columns = inspector.get_columns('equivalency_items', schema='a76')
|
||||
for column in columns:
|
||||
print(f"Column: {column['name']} - Type: {column['type']}")
|
||||
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
check_equivalencies_columns()
|
||||
30
check_db.py
30
check_db.py
@@ -1,30 +0,0 @@
|
||||
import sys
|
||||
import os
|
||||
from sqlalchemy import create_engine, text, inspect
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
|
||||
# Add the backend directory to the python path
|
||||
sys.path.append(os.path.join(os.getcwd(), 'backend'))
|
||||
|
||||
from core.config import settings
|
||||
|
||||
def check_equivalencies_columns():
|
||||
engine = create_engine(str(settings.core_database_url))
|
||||
inspector = inspect(engine)
|
||||
|
||||
try:
|
||||
print("Checking equivalencies table columns...")
|
||||
columns = inspector.get_columns('equivalencies', schema='a76')
|
||||
for column in columns:
|
||||
print(f"Column: {column['name']} - Type: {column['type']}")
|
||||
|
||||
print("\nChecking equivalency_items table columns...")
|
||||
columns = inspector.get_columns('equivalency_items', schema='a76')
|
||||
for column in columns:
|
||||
print(f"Column: {column['name']} - Type: {column['type']}")
|
||||
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
|
||||
if __name__ == "__main__":
|
||||
check_equivalencies_columns()
|
||||
23
check_uom.py
23
check_uom.py
@@ -1,23 +0,0 @@
|
||||
import sys
|
||||
import os
|
||||
|
||||
# Add backend to path
|
||||
sys.path.append(os.path.join(os.getcwd(), 'backend'))
|
||||
|
||||
from core.database import CoreSessionLocal
|
||||
from api.v1.modules.a76.general_catalogs.units_of_measure.models import UnitOfMeasure
|
||||
|
||||
def check_units():
|
||||
db = CoreSessionLocal()
|
||||
try:
|
||||
units = db.query(UnitOfMeasure).limit(10).all()
|
||||
print(f"Found {len(units)} units:")
|
||||
for u in units:
|
||||
print(f"Code: {u.code}, Description: {u.description}")
|
||||
except Exception as e:
|
||||
print(f"Error: {e}")
|
||||
finally:
|
||||
db.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
check_units()
|
||||
Reference in New Issue
Block a user