diff --git a/src/database/migrations/5-fifth-migration.sql b/src/database/migrations/5-fifth-migration.sql new file mode 100644 index 0000000..707b828 --- /dev/null +++ b/src/database/migrations/5-fifth-migration.sql @@ -0,0 +1,2 @@ +ALTER TABLE releases DROP COLUMN created_at; +ALTER TABLE releases ADD created_at timestamp; diff --git a/src/server/dbal/dbal.ts b/src/server/dbal/dbal.ts index ca70705..70411ed 100644 --- a/src/server/dbal/dbal.ts +++ b/src/server/dbal/dbal.ts @@ -76,13 +76,13 @@ export const getRelease = async (where: { export const insertRelease = async (props: {manifest: PicobookManifest, carts: {name: string; rom: number[]}[]}) => { const {manifest, carts} = props; - console.log('carts', JSON.stringify(carts)); + // console.log('carts', JSON.stringify(carts)); const {id: slug, author, repo, version} = manifest; const id = uuidv4(); const now = new Date(); await db.query(sql` INSERT INTO releases (id, slug, repo, version, author, carts, manifest, created_at) - VALUES (${id}, ${slug}, ${repo}, ${version}, ${author}, ${JSON.stringify(carts)}, ${manifest}, ${now}) + VALUES (${id}, ${slug}, ${repo}, ${version}, ${author}, ${carts}, ${manifest}, ${now}) `); return id; }