Public trips - Rename fields in host request#7740
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude finished @nabramow's task in 2m 3s —— View job Migration Safety Review Complete
Result: SAFE - The migration |
Migration ReviewOne of our most common issues is migrations that don't work with existing data in production. This is very hard to catch with CI, so we have this bot to check for potential problems. Overall Risk: SAFE Files Reviewed
FindingsNo issues found. Column renames ( The defensive Note: The downgrade raises SummaryThis is a safe, metadata-only migration. All 11 column renames, 4 index renames, and 2 FK constraint renames are correctly mapped and match the model changes in |
|
Claude finished @nabramow's task in 1m 49s —— View job Migration Safety Review Complete
Result: SAFE - The migration |
aapeliv
left a comment
There was a problem hiding this comment.
some comments. let's just change the column names in the host request table in this PR
| conn = op.get_bind() | ||
| inspector = inspect(conn) | ||
| columns = {col["name"] for col in inspector.get_columns("host_requests")} | ||
| indexes = {idx["name"] for idx in inspector.get_indexes("host_requests")} | ||
|
|
||
| # Helper to rename column only if old name exists | ||
| def rename_column(old_name, new_name): | ||
| if old_name in columns: | ||
| op.alter_column("host_requests", old_name, new_column_name=new_name) | ||
|
|
||
| # Helper to rename index only if old name exists | ||
| def rename_index(old_name, new_name): | ||
| if old_name in indexes: | ||
| op.execute(f"ALTER INDEX {old_name} RENAME TO {new_name}") |
There was a problem hiding this comment.
Let's not do this; just normal renaming per-column please
|
|
||
|
|
||
| def create_test_host_request_with_moderation(surfer_token, host_user_id): | ||
| def create_test_host_request_with_moderation(surfer_token, recipient_user_id): |
| initiator_user_id: int, | ||
| recipient_user_id: int, |
| } | ||
|
|
||
| message CreateHostRequestReq { | ||
| int64 host_user_id = 1; |
There was a problem hiding this comment.
The API surface shouldn't change
Describe briefly what this PR is doing and why.
Closes #7739
To prepare for public trips, we will first rename surfer_user_id and host_user_id to recipient and initiator. This is because public trips will allow us going both directions so the surfer initiates normally but host initiates with public trips.
Testing
Explain how you tested this PR and give clear steps so the reviewer can replicate.
Backend checklist
developif necessary for linear migration historyFor maintainers