saved new files
This commit is contained in:
@@ -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.")
|
||||
Reference in New Issue
Block a user