mirror of https://github.com/wg-easy/wg-easy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
729 B
24 lines
729 B
import { sql } from 'drizzle-orm';
|
|
import { int, sqliteTable, text } from 'drizzle-orm/sqlite-core';
|
|
|
|
import { wgInterface } from '../../schema';
|
|
|
|
export const hooks = sqliteTable('hooks_table', {
|
|
id: int()
|
|
.primaryKey({ autoIncrement: true })
|
|
.references(() => wgInterface.id, {
|
|
onDelete: 'cascade',
|
|
onUpdate: 'cascade',
|
|
}),
|
|
preUp: text('pre_up').notNull(),
|
|
postUp: text('post_up').notNull(),
|
|
preDown: text('pre_down').notNull(),
|
|
postDown: text('post_down').notNull(),
|
|
createdAt: text('created_at')
|
|
.notNull()
|
|
.default(sql`(CURRENT_TIMESTAMP)`),
|
|
updatedAt: text('updated_at')
|
|
.notNull()
|
|
.default(sql`(CURRENT_TIMESTAMP)`)
|
|
.$onUpdate(() => sql`(CURRENT_TIMESTAMP)`),
|
|
});
|
|
|