saved new files

This commit is contained in:
2025-09-10 21:50:08 +03:00
parent 2b84b13524
commit bb3352ea4a
8 changed files with 71 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
import mariadb
from app.warehouse import get_db_connection
from flask import Flask
import os
def create_warehouse_locations_table():
conn = get_db_connection()
cursor = conn.cursor()
cursor.execute('''
CREATE TABLE IF NOT EXISTS warehouse_locations (
id BIGINT AUTO_INCREMENT PRIMARY KEY,
location_code VARCHAR(12) NOT NULL UNIQUE,
size INT,
description VARCHAR(250)
)
''')
conn.commit()
conn.close()
if __name__ == "__main__":
instance_path = os.path.abspath("instance")
app = Flask(__name__, instance_path=instance_path)
with app.app_context():
create_warehouse_locations_table()
print("warehouse_locations table created or already exists.")