Files
klz-cables.com/.pnpm-store/v10/files/a2/373fd0416dc2371a3604e08cb8a60c3f051bbcff386d514a23efa54f6ef8298acbdd9c7db5e84c1861297e4c08ce9004cbf193db0a1db314f8d7cc731dcfdc
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

25 lines
846 B
Plaintext

export const migrationTableExists = async (adapter, db)=>{
let statement;
if (adapter.name === 'postgres') {
const prependSchema = adapter.schemaName ? `"${adapter.schemaName}".` : '';
statement = `SELECT to_regclass('${prependSchema}"payload_migrations"') AS exists;`;
}
if (adapter.name === 'sqlite') {
statement = `
SELECT CASE
WHEN COUNT(*) > 0 THEN 1
ELSE 0
END AS 'exists'
FROM sqlite_master
WHERE type = 'table'
AND name = 'payload_migrations';`;
}
const result = await adapter.execute({
drizzle: db ?? adapter.drizzle,
raw: statement
});
const [row] = result.rows;
return row && typeof row === 'object' && 'exists' in row && !!row.exists;
};
//# sourceMappingURL=migrationTableExists.js.map