0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-02-24 22:46:02 -05:00

Revert "wip: demo ready"

This reverts commit 37585ce5cb.
This commit is contained in:
bholmesdev 2024-03-01 13:25:02 -05:00
parent ff8c571af1
commit b6ce9894c1
3 changed files with 22 additions and 16 deletions

View file

@ -1,4 +1,5 @@
import { defineDB, defineTable, column, sql, NOW } from 'astro:db';
import { defineDB, defineTable, column } from 'astro:db';
import { Themes } from './theme';
const Author = defineTable({
columns: {
@ -6,20 +7,6 @@ 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 },
});

View file

@ -1,4 +1,8 @@
import { db, Themes, Author } from 'astro:db';
import { db, Author } from 'astro:db';
import { Themes as ThemesConfig } from './theme';
import { asDrizzleTable } from '@astrojs/db/utils';
const Themes = asDrizzleTable('Themes', ThemesConfig);
await db
.insert(Themes)

View file

@ -0,0 +1,15 @@
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` }),
},
});