diff --git a/packages/db/test/fixtures/basics/db/config.ts b/packages/db/test/fixtures/basics/db/config.ts index b2ed2066f1e1..60b0b2295d54 100644 --- a/packages/db/test/fixtures/basics/db/config.ts +++ b/packages/db/test/fixtures/basics/db/config.ts @@ -1,5 +1,4 @@ -import { defineDB, defineTable, column } from 'astro:db'; -import { Themes } from './theme'; +import { defineDB, defineTable, column, sql, NOW } from 'astro:db'; const Author = defineTable({ columns: { @@ -7,6 +6,20 @@ const Author = defineTable({ }, }); +const Themes = defineTable({ + columns: { + name: column.text(), + added: column.date({ + default: sql`CURRENT_TIMESTAMP`, + }), + updated: column.date({ + default: NOW, + }), + isDark: column.boolean({ default: sql`TRUE` }), + owner: column.text({ optional: true, default: sql`NULL` }), + }, +}); + export default defineDB({ tables: { Author, Themes }, }); diff --git a/packages/db/test/fixtures/basics/db/seed.ts b/packages/db/test/fixtures/basics/db/seed.ts index c1b61e0996db..8f47092a9cb9 100644 --- a/packages/db/test/fixtures/basics/db/seed.ts +++ b/packages/db/test/fixtures/basics/db/seed.ts @@ -1,8 +1,4 @@ -import { db, Author } from 'astro:db'; -import { Themes as ThemesConfig } from './theme'; -import { asDrizzleTable } from '@astrojs/db/utils'; - -const Themes = asDrizzleTable('Themes', ThemesConfig); +import { db, Themes, Author } from 'astro:db'; await db .insert(Themes) diff --git a/packages/db/test/fixtures/basics/db/theme.ts b/packages/db/test/fixtures/basics/db/theme.ts deleted file mode 100644 index d3b89b68c4b8..000000000000 --- a/packages/db/test/fixtures/basics/db/theme.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { defineTable, column, NOW, sql } from 'astro:db'; - -export const Themes = defineTable({ - columns: { - name: column.text(), - added: column.date({ - default: sql`CURRENT_TIMESTAMP`, - }), - updated: column.date({ - default: NOW, - }), - isDark: column.boolean({ default: sql`TRUE` }), - owner: column.text({ optional: true, default: sql`NULL` }), - }, -});