Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Atendees table db #37

Merged
merged 6 commits into from
Jan 15, 2025
Merged

Atendees table db #37

merged 6 commits into from
Jan 15, 2025

Conversation

tran2106
Copy link
Collaborator

I added attendee table and fields ( id | event_id | first_name | last_name | email | phone_number | image_url )

@tran2106 tran2106 requested a review from dianaabishop January 13, 2025 18:10
Copy link
Member

@dianaabishop dianaabishop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! I see you added Go files to run this SQL - which is very reasonable - but to match the existing pattern, I think it's probably easier and more consistant to add the SQL as a .sql file in the sql directory! Then everyone will have to run the SQL on their own local environments to create the table on their databases. I have a few lil comments about the create SQL but I'll leave them inline in the code so it's easier to identify what I'm talking about! Let me know if any of this could use additional clarification!

createTableQuery := `
CREATE TABLE IF NOT EXISTS attendees (
id INT AUTO_INCREMENT PRIMARY KEY,
event_id INT,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove the event_id on this table; the rsvp table will eventually link the attendee to the event (since one attendee could RSVP for multiple different events)!

last_name VARCHAR(255) NOT NULL,
email VARCHAR(255) NOT NULL,
phone_number VARCHAR(20),
image_url VARCHAR(255),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am a fan of short URLs (I work at Bitly, after all 😆 ) but in theory, I think a URL can be up to 2048 characters so just to be safe, but be better to set this to VARCHAR(2048)?

email VARCHAR(255) NOT NULL,
phone_number VARCHAR(20),
image_url VARCHAR(255),
FOREIGN KEY (event_id) REFERENCES events(id)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yay foreign keys!! We'll want to remove it in this case because we're removing event_id, but I love the idea of adding it to the RSVP table (for attendee_id when we add that and for event_id as well)!

Copy link
Collaborator Author

@tran2106 tran2106 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.

Copy link
Member

@dianaabishop dianaabishop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great to me!! Once you merge this, perhaps post in the #sprinterns2025 channel to let people know that they should run your SQL on their local environments!

@tran2106 tran2106 merged commit 61c0881 into main Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants