moved stuff + scanner com/hid edits

This commit is contained in:
2026-03-17 17:25:14 -03:00
parent 9cf0792866
commit 0fcb8ce473
1228 changed files with 382 additions and 151555 deletions

View File

@@ -0,0 +1,29 @@
import sqlite3
DB_FILE = 'db/pos_database.db'
def upgrade_db():
try:
with sqlite3.connect(DB_FILE) as conn:
<<<<<<< HEAD
=======
# Add stock column
# conn.execute("ALTER TABLE products ADD COLUMN stock REAL DEFAULT 0")
# print("Successfully added 'stock' column.")
# # App.py also expects unit_type, adding it to prevent future headaches
# conn.execute("ALTER TABLE products ADD COLUMN unit_type TEXT DEFAULT 'unit'")
# print("Successfully added 'unit_type' column.")
>>>>>>> 1a048a0e074ee26bd45dda9731c78c2ecef42fba
conn.execute("ALTER TABLE dicom ADD COLUMN image_url TEXT;")
print("Successfully added 'image_url' column.")
conn.commit()
print("Migration complete. Your data is intact.")
except sqlite3.OperationalError as e:
print(f"Skipped: {e}. (This usually means the columns already exist, so you're fine).")
if __name__ == '__main__':
upgrade_db()