- Replace Astro DB with better-sqlite3 for reliable SQLite access - Implement Export CSV feature in admin panel - Fix delete consent function (make it global) - Add better-sqlite3 dependency
20 lines
507 B
TypeScript
20 lines
507 B
TypeScript
import { defineDb, defineTable, column } from 'astro:db';
|
|
|
|
export const ConsentLog = defineTable({
|
|
columns: {
|
|
id: column.number({ primaryKey: true, autoIncrement: true }),
|
|
sessionId: column.text({ unique: true }),
|
|
timestamp: column.date(),
|
|
essential: column.boolean(),
|
|
analytics: column.boolean(),
|
|
marketing: column.boolean(),
|
|
policyVersion: column.text(),
|
|
ipHash: column.text(),
|
|
userAgent: column.text()
|
|
}
|
|
});
|
|
|
|
export default defineDb({
|
|
tables: { ConsentLog }
|
|
});
|