From 145f4b23baf6072d90d1dda34f171a6bb4b76a84 Mon Sep 17 00:00:00 2001 From: Marcos Prieto Date: Tue, 7 Jan 2025 10:20:00 +0100 Subject: [PATCH] Migration to add start/end dates to courses --- ...8ad39_add_start_and_end_dates_for_courses.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 lms/migrations/versions/0aa54a98ad39_add_start_and_end_dates_for_courses.py diff --git a/lms/migrations/versions/0aa54a98ad39_add_start_and_end_dates_for_courses.py b/lms/migrations/versions/0aa54a98ad39_add_start_and_end_dates_for_courses.py new file mode 100644 index 0000000000..6a5c576a00 --- /dev/null +++ b/lms/migrations/versions/0aa54a98ad39_add_start_and_end_dates_for_courses.py @@ -0,0 +1,17 @@ +"""Add start and end dates to courses.""" + +import sqlalchemy as sa +from alembic import op + +revision = "0aa54a98ad39" +down_revision = "02d413b4d212" + + +def upgrade() -> None: + op.add_column("lms_course", sa.Column("starts_at", sa.DateTime(), nullable=True)) + op.add_column("lms_course", sa.Column("ends_at", sa.DateTime(), nullable=True)) + + +def downgrade() -> None: + op.drop_column("lms_course", "ends_at") + op.drop_column("lms_course", "starts_at")