mirror of
https://github.com/withastro/astro.git
synced 2025-02-24 22:46:02 -05:00
refactor: remove integrations from test for now
This commit is contained in:
parent
80154b4f8e
commit
8886b5cd39
4 changed files with 22 additions and 19 deletions
29
packages/db/test/fixtures/basics/astro.config.ts
vendored
29
packages/db/test/fixtures/basics/astro.config.ts
vendored
|
@ -1,6 +1,5 @@
|
||||||
import db, { defineTable, column } from '@astrojs/db';
|
import db, { defineTable, column, sql, NOW } from '@astrojs/db';
|
||||||
import { defineConfig } from 'astro/config';
|
import { defineConfig } from 'astro/config';
|
||||||
import { themes } from './themes-integration';
|
|
||||||
|
|
||||||
const Author = defineTable({
|
const Author = defineTable({
|
||||||
columns: {
|
columns: {
|
||||||
|
@ -8,11 +7,25 @@ const Author = defineTable({
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
// https://astro.build/config
|
// TODO: add back integration test
|
||||||
export default defineConfig({
|
const Themes = defineTable({
|
||||||
integrations: [db(), themes()],
|
columns: {
|
||||||
db: {
|
name: column.text(),
|
||||||
tables: { Author },
|
added: column.date({
|
||||||
unsafeDisableStudio: true,
|
default: sql`CURRENT_TIMESTAMP`,
|
||||||
|
}),
|
||||||
|
updated: column.date({
|
||||||
|
default: NOW,
|
||||||
|
}),
|
||||||
|
isDark: column.boolean({ default: sql`TRUE` }),
|
||||||
|
owner: column.text({ optional: true, default: sql`NULL` }),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
// https://astro.build/config
|
||||||
|
export default defineConfig({
|
||||||
|
integrations: [db()],
|
||||||
|
db: {
|
||||||
|
tables: { Author, Themes },
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
11
packages/db/test/fixtures/basics/db/seed.prod.ts
vendored
11
packages/db/test/fixtures/basics/db/seed.prod.ts
vendored
|
@ -1,11 +0,0 @@
|
||||||
import { db, Author } from 'astro:db';
|
|
||||||
|
|
||||||
await db
|
|
||||||
.insert(Author)
|
|
||||||
.values([
|
|
||||||
{ name: 'Ben' },
|
|
||||||
{ name: 'Nate' },
|
|
||||||
{ name: 'Erika' },
|
|
||||||
{ name: 'Bjorn' },
|
|
||||||
{ name: 'Sarah' },
|
|
||||||
]);
|
|
|
@ -1,4 +1,5 @@
|
||||||
---
|
---
|
||||||
|
/// <reference path="../../.astro/db-types.d.ts" />
|
||||||
import { Author, db, Themes } from 'astro:db';
|
import { Author, db, Themes } from 'astro:db';
|
||||||
|
|
||||||
const authors = await db.select().from(Author);
|
const authors = await db.select().from(Author);
|
||||||
|
|
Loading…
Add table
Reference in a new issue