docs: a to-do app as the example schema in the docs, fixtures and tests
This commit is contained in:
@@ -11,14 +11,14 @@ export function catalog() {
|
||||
{ schema: 'demo', name: 'users', kind: 'table', primaryKey: ['id'],
|
||||
columns: [col('id', 'integer'), col('name'), col('password_hash'), col('limit', 'integer'), col('manager_id', 'integer')],
|
||||
foreignKeys: [{ columns: ['manager_id'], target: { schema: 'demo', table: 'users' }, targetColumns: ['id'] }] },
|
||||
{ schema: 'demo', name: 'assets', kind: 'table', primaryKey: ['id'],
|
||||
columns: [col('id', 'integer'), col('name'), col('status'), col('owner_id', 'integer'), col('cost', 'number'), col('active', 'boolean'), col('created_at', 'timestamp', { generated: true })],
|
||||
{ schema: 'demo', name: 'todos', kind: 'table', primaryKey: ['id'],
|
||||
columns: [col('id', 'integer'), col('name'), col('status'), col('owner_id', 'integer'), col('estimate', 'number'), col('pinned', 'boolean'), col('created_at', 'timestamp', { generated: true })],
|
||||
foreignKeys: [{ columns: ['owner_id'], target: { schema: 'demo', table: 'users' }, targetColumns: ['id'] }] },
|
||||
{ schema: 'demo', name: 'tags', kind: 'table', primaryKey: ['id'], columns: [col('id', 'integer'), col('name')], foreignKeys: [] },
|
||||
{ schema: 'demo', name: 'asset_tags', kind: 'table', primaryKey: ['asset_id', 'tag_id'],
|
||||
columns: [col('asset_id', 'integer'), col('tag_id', 'integer')],
|
||||
{ schema: 'demo', name: 'todo_tags', kind: 'table', primaryKey: ['todo_id', 'tag_id'],
|
||||
columns: [col('todo_id', 'integer'), col('tag_id', 'integer')],
|
||||
foreignKeys: [
|
||||
{ columns: ['asset_id'], target: { schema: 'demo', table: 'assets' }, targetColumns: ['id'] },
|
||||
{ columns: ['todo_id'], target: { schema: 'demo', table: 'todos' }, targetColumns: ['id'] },
|
||||
{ columns: ['tag_id'], target: { schema: 'demo', table: 'tags' }, targetColumns: ['id'] },
|
||||
] },
|
||||
{ schema: 'other', name: 'secrets', kind: 'table', primaryKey: ['id'], columns: [col('id', 'integer')], foreignKeys: [] },
|
||||
|
||||
Reference in New Issue
Block a user