Merge branch 'main' into alp/teams_scripts

This commit is contained in:
Alex Petric
2025-02-06 11:15:56 -05:00
6 changed files with 51 additions and 10 deletions
@@ -0,0 +1,12 @@
{
"db_name": "PostgreSQL",
"query": "DELETE FROM _sqlx_migrations WHERE version=20250201145632",
"describe": {
"columns": [],
"parameters": {
"Left": []
},
"nullable": []
},
"hash": "67f671d3feb0c7beedd2e99740fec9c0f01b077026c0be08e87b9ba65fde5608"
}
@@ -1,8 +0,0 @@
-- Add up migration script here
-- Migrate `v2_job_queue` moved columns to `v2_job_runtime`:
INSERT INTO v2_job_runtime (id, ping, memory_peak)
SELECT id, __last_ping, __mem_peak
FROM v2_job_queue
-- Locked ones will sync within triggers
FOR UPDATE SKIP LOCKED
ON CONFLICT (id) DO NOTHING;
@@ -0,0 +1,12 @@
-- Add up migration script here
UPDATE v2_job_queue SET
running = false,
started_at = NULL
WHERE running = true AND NOT EXISTS (SELECT 1 FROM v2_job_runtime WHERE id = v2_job_queue.id);
INSERT INTO v2_job_runtime (id, ping, memory_peak)
SELECT id, __last_ping, __mem_peak
FROM v2_job_queue
-- Locked ones will sync within triggers
FOR UPDATE SKIP LOCKED
ON CONFLICT (id) DO NOTHING;
+8
View File
@@ -180,6 +180,14 @@ pub async fn migrate(db: &DB) -> Result<(), Error> {
tracing::info!("Could not remove sqlx migration with version=20250131115248: {err:#}");
}
// Remove the migration `v2_fix_no_runtime` in favor of `v2_fix_no_runtime_2`.
if let Err(err) = sqlx::query!("DELETE FROM _sqlx_migrations WHERE version=20250201145632")
.execute(db)
.await
{
tracing::info!("Could not remove sqlx migration with version=20250201145632: {err:#}");
}
match sqlx::migrate!("../migrations")
.run_direct(&mut custom_migrator)
.await
@@ -76,12 +76,29 @@
$: resolvedConfig.beforeIcon && beforeIconComponent && handleBeforeIcon()
$: resolvedConfig.afterIcon && afterIconComponent && handleAfterIcon()
function getIconSize() {
switch (resolvedConfig.size as 'xs' | 'sm' | 'md' | 'lg' | 'xl') {
case 'xs':
return 14
case 'sm':
return 16
case 'md':
return 20
case 'lg':
return 24
case 'xl':
return 26
default:
return 24
}
}
async function handleBeforeIcon() {
if (resolvedConfig.beforeIcon) {
beforeIconComponent = await loadIcon(
resolvedConfig.beforeIcon,
beforeIconComponent,
14,
getIconSize(),
undefined,
undefined
)
@@ -93,7 +110,7 @@
afterIconComponent = await loadIcon(
resolvedConfig.afterIcon,
afterIconComponent,
14,
getIconSize(),
undefined,
undefined
)