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

🎉 cloudflare images DB setup #4274

Merged
merged 1 commit into from
Dec 10, 2024
Merged

🎉 cloudflare images DB setup #4274

merged 1 commit into from
Dec 10, 2024

Conversation

ikesau
Copy link
Member

@ikesau ikesau commented Dec 10, 2024

Just the DB changes from #4214 so that we can merge this first, make sure the DB data is correct, and then merge the code changes

@ikesau ikesau requested a review from rakyi December 10, 2024 15:57
@ikesau ikesau self-assigned this Dec 10, 2024
@owidbot
Copy link
Contributor

owidbot commented Dec 10, 2024

Quick links (staging server):

Site Dev Site Preview Admin Wizard Docs

Login: ssh owid@staging-site-cloudflare-images-prep

SVG tester:

Number of differences (default views): 0 ✅
Number of differences (all views): 0 ✅

Edited: 2024-12-10 16:58:58 UTC
Execution time: 1.28 seconds

Comment on lines +9 to +11
ADD COLUMN hash VARCHAR(255) NULL,
MODIFY COLUMN googleId VARCHAR(255) NULL,
MODIFY COLUMN defaultAlt VARCHAR(1600) NULL;`)
Copy link
Contributor

Choose a reason for hiding this comment

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

I just remembered there is this convention I like that I learned when using Django, where you don't allow char/text fields to be null, because then you have two ways to represent an empty value — empty string and null — and you usually don't want that.

We don't have to change it now, especially if you don't feel like you'd have enough time to test it. Otherwise, I think it would be good to do or just think about it in the future.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, that's true, the billion dollar mistake and all. Maybe let's pen that in for a tech tea to see if we want to set a strong commitment to standardizing on this throughout the DB.

"Are you sure you want to delete ALL images from Cloudflare Images? (y/n) ",
(answer) => {
if (answer.toLowerCase() === "y") {
console.log("May God have mercy on your soul.")
Copy link
Contributor

Choose a reason for hiding this comment

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

lol

}

await db.knexReadWriteTransaction(async (trx) => {
// await purgeRecords(trx)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this commented out on purpose?

@ikesau ikesau merged commit 0f5903e into master Dec 10, 2024
28 checks passed
@ikesau ikesau deleted the cloudflare-images-prep branch December 10, 2024 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants