import fs from 'node:fs'
import path from 'node:path'
import { fileURLToPath } from 'node:url'

const __dirname = path.dirname(fileURLToPath(import.meta.url))
const origen = path.join(__dirname, '../src/db/schema.sql')
const destinoDir = path.join(__dirname, '../dist/db')
const destino = path.join(destinoDir, 'schema.sql')

fs.mkdirSync(destinoDir, { recursive: true })
fs.copyFileSync(origen, destino)
console.log('schema.sql copiado a dist/db/')
