fix: add missing ai_providers columns and fix linux-amd64 build #41

Merged
sarman merged 3 commits from fix/ai-provider-migration-issue into master 2026-04-13 17:00:51 +00:00
2 changed files with 9 additions and 8 deletions
Showing only changes of commit 8e1d43da43 - Show all commits

View File

@ -26,9 +26,12 @@ RUN apt-get update -qq \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
# Install linuxdeploy for AppImage bundling (required for Tauri 2.x) # Install linuxdeploy for AppImage bundling (required for Tauri 2.x)
# Download linuxdeploy from the official repository and extract AppImage # Download linuxdeploy AppImage and extract to get the binary
RUN curl -fsSL -L https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -o /usr/local/bin/linuxdeploy \ RUN curl -Ls https://github.com/tauri-apps/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -o /tmp/linuxdeploy.AppImage \
&& chmod +x /usr/local/bin/linuxdeploy && chmod +x /tmp/linuxdeploy.AppImage \
&& /tmp/linuxdeploy.AppImage --appimage-extract \
&& mv squashfs-root/usr/bin/linuxdeploy /usr/local/bin/ \
&& rm -rf /tmp/linuxdeploy.AppImage squashfs-root
RUN rustup target add x86_64-unknown-linux-gnu \ RUN rustup target add x86_64-unknown-linux-gnu \
&& rustup component add rustfmt clippy && rustup component add rustfmt clippy

View File

@ -197,7 +197,7 @@ pub fn run_migrations(conn: &Connection) -> anyhow::Result<()> {
), ),
( (
"016_add_created_at", "016_add_created_at",
"ALTER TABLE ai_providers ADD COLUMN created_at TEXT NOT NULL DEFAULT (datetime('now'))", "ALTER TABLE ai_providers ADD COLUMN created_at TEXT NOT NULL DEFAULT (strftime('%Y-%m-%d %H:%M:%S', 'now'))",
), ),
]; ];
@ -218,12 +218,10 @@ pub fn run_migrations(conn: &Connection) -> anyhow::Result<()> {
|| name.ends_with("_add_created_at") || name.ends_with("_add_created_at")
{ {
// Use execute for ALTER TABLE (SQLite only allows one statement per command) // Use execute for ALTER TABLE (SQLite only allows one statement per command)
// Skip error if column already exists // Skip error if column already exists (SQLITE_ERROR with "duplicate column name")
if let Err(e) = conn.execute(sql, []) { if let Err(e) = conn.execute(sql, []) {
let err_str = e.to_string(); let err_str = e.to_string();
if err_str.contains("duplicate column name") if err_str.contains("duplicate column name") {
|| err_str.contains("has no column named")
{
tracing::info!("Column may already exist, skipping migration {name}: {e}"); tracing::info!("Column may already exist, skipping migration {name}: {e}");
} else { } else {
return Err(e.into()); return Err(e.into());