Skip to content

Commit

Permalink
feat: apis for learning circle meetups
Browse files Browse the repository at this point in the history
  • Loading branch information
aswanthabam committed Oct 12, 2024
1 parent a3638bd commit 8b1f7c6
Show file tree
Hide file tree
Showing 7 changed files with 922 additions and 544 deletions.
10 changes: 6 additions & 4 deletions alter-scripts/alter-1.55.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def get_circle_meeting_logs():


def create_attendees_table():
query = """create table circle_meet_attendees (
query = """CREATE TABLE circle_meet_attendees (
id VARCHAR(36) PRIMARY KEY NOT NULL,
meet_id VARCHAR(36) NOT NULL,
user_id VARCHAR(36) NOT NULL,
Expand All @@ -40,7 +40,7 @@ def create_attendees_table():

def migrate_attendees_to_table():
for meet_id, attendees, created_at, updated_at, images in get_circle_meeting_logs():
attendees = attendees.split(",")
attendees = (attendees if attendees else "").split(",")
meet_code = "OLD" + generate_code(3)
query = f"UPDATE circle_meeting_log SET meet_code = '{meet_code}', is_started = {int(images is not None)}, is_report_submitted = {int(images is not None)} WHERE id = '{meet_id}'"
execute(query)
Expand All @@ -59,13 +59,15 @@ def migrate_attendees_to_table():
"""
ALTER TABLE circle_meeting_log
MODIFY COLUMN `day` VARCHAR(20),
MODIFY COLUMN meet_time DATETIME,
ADD COLUMN title VARCHAR(100) NOT NULL AFTER circle_id,
ADD COLUMN location VARCHAR(200) NOT NULL AFTER meet_place,
ADD COLUMN meet_code VARCHAR(6) NOT NULL AFTER id,
ADD COLUMN pre_requirements VARCHAR(1000) AFTER agenda,
ADD COLUMN is_public BOOLEAN DEFAULT TRUE NOT NULL AFTER pre_requirements,
ADD COLUMn max_attendees INT DEFAULT -1 AFTER pre_requirements,
ADD COLUMN is_started BOOLEAN DEFAULT FALSE NOT NULL AFTER max_attendees,
ADD COLUMN is_report_submitted BOOLEAN DEFAULT FALSE NOT NULL AFTER is_started
ADD COLUMN report_text VARCHAR(1000) AFTER max_attendees,
ADD COLUMN is_report_submitted BOOLEAN DEFAULT FALSE NOT NULL AFTER report_text
"""
)
migrate_attendees_to_table()
Expand Down
Loading

0 comments on commit 8b1f7c6

Please sign in to comment.