-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
26 lines (23 loc) · 933 Bytes
/
Copy pathrun.py
File metadata and controls
26 lines (23 loc) · 933 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from app import create_app, db
from app.models import Category
app = create_app()
with app.app_context():
db.create_all()
if Category.query.count() == 0:
categories = [
Category(name='Power Tools', icon='⚡'),
Category(name='Hand Tools', icon='🔨'),
Category(name='Garden & Outdoor', icon='🌿'),
Category(name='Measuring & Layout', icon='📐'),
Category(name='Plumbing', icon='🚿'),
Category(name='Electrical', icon='💡'),
Category(name='Automotive', icon='🚗'),
Category(name='Ladders & Scaffolding', icon='🪜'),
Category(name='Cleaning & Maintenance', icon='🧹'),
Category(name='Other', icon='🔧'),
]
db.session.add_all(categories)
db.session.commit()
print("Seeded categories.")
if __name__ == '__main__':
app.run(debug=True, port=5002)