added initial db as migration
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { sqliteTable, text, integer, real } from 'drizzle-orm/sqlite-core';
|
||||
import { relations } from 'drizzle-orm';
|
||||
import { relations, sql } from 'drizzle-orm';
|
||||
import { dataset_entry } from './dataset_entry';
|
||||
|
||||
// Define the dataset table schema
|
||||
@@ -8,10 +8,10 @@ export const dataset = sqliteTable('dataset', {
|
||||
name: text('name').notNull(),
|
||||
createdAt: integer('created_at', { mode: 'timestamp' })
|
||||
.notNull()
|
||||
.default(new Date()),
|
||||
.default(sql`(CURRENT_TIMESTAMP)`),
|
||||
updatedAt: integer('updated_at', { mode: 'timestamp' })
|
||||
.notNull()
|
||||
.default(new Date())
|
||||
.default(sql`(CURRENT_TIMESTAMP)`),
|
||||
});
|
||||
|
||||
export const datasetRelations = relations(dataset, ({ many }) => ({
|
||||
|
||||
Reference in New Issue
Block a user