diff --git a/crud.py b/crud.py index 0d9c25b..ed4857c 100644 --- a/crud.py +++ b/crud.py @@ -92,14 +92,15 @@ async def create_event(data: CreateEvent) -> Event: event_id = urlsafe_short_hash() await db.execute( """ - INSERT INTO events.events (id, wallet, name, info, closing_date, event_start_date, event_end_date, currency, amount_tickets, price_per_ticket, sold) - VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + INSERT INTO events.events (id, wallet, name, info, banner, closing_date, event_start_date, event_end_date, currency, amount_tickets, price_per_ticket, sold) + VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) """, ( event_id, data.wallet, data.name, data.info, + data.banner, data.closing_date, data.event_start_date, data.event_end_date, diff --git a/migrations.py b/migrations.py index 8052e3f..87a0dd4 100644 --- a/migrations.py +++ b/migrations.py @@ -153,3 +153,10 @@ async def m004_add_currency(db): ) await db.execute("DROP TABLE events.events_old") + + +async def m005_add_image_banner(db): + """ + Add a column to allow an image banner for the event + """ + await db.execute("ALTER TABLE events.events ADD COLUMN banner TEXT;") diff --git a/models.py b/models.py index 2798c12..2b24098 100644 --- a/models.py +++ b/models.py @@ -7,6 +7,7 @@ class CreateEvent(BaseModel): wallet: str name: str info: str + banner: Optional[str] closing_date: str event_start_date: str event_end_date: str @@ -25,6 +26,7 @@ class Event(BaseModel): wallet: str name: str info: str + banner: Optional[str] closing_date: str event_start_date: str event_end_date: str diff --git a/templates/events/display.html b/templates/events/display.html index 60ec944..840d15c 100644 --- a/templates/events/display.html +++ b/templates/events/display.html @@ -1,9 +1,10 @@ {% extends "public.html" %} {% block page %}