import{s as e}from"./DrKWWDpL.js";import{t}from"./DYP3EJMY.js";function n(e){let t=parseInt(e.slice(0,4),10),n=parseInt(e.slice(4,6),10)-1,r=parseInt(e.slice(6,8),10),i=parseInt(e.slice(8,10),10),a=parseInt(e.slice(10,12),10),o=parseInt(e.slice(12,14),10);return Date.UTC(t,n,r,i,a,o)}function r(e){let{localMigrations:t,dbMigrations:n}=e,r=new Set(n.map(e=>e.name).filter(e=>e!==null));return t.filter(e=>!e.name||!r.has(e.name))}var i=e(t(),1);function a(e){if(i.default.existsSync(`${e.migrationsFolder}/meta/_journal.json`))throw Error(`We detected that you have old drizzle-kit migration folders. You must upgrade drizzle-kit and run "drizzle-kit up"`);let t=e.migrationsFolder,r=[],a=(0,i.readdirSync)(t).map(e=>({path:(0,i.join)(t,e,`migration.sql`),name:e})).filter(e=>(0,i.existsSync)(e.path));a.sort((e,t)=>e.name.localeCompare(t.name));for(let e of a){let t=e.path,a=e.name.slice(0,14),o=i.default.readFileSync(t).toString(),s=o.split(`--> statement-breakpoint`).map(e=>e),c=n(a);r.push({sql:s,bps:!0,folderMillis:c,hash:i.default.createHash(`sha256`).update(o).digest(`hex`),name:e.name})}return r}export{r as n,a as t};