feat: add versioned migrations and kysely query layer

This commit is contained in:
Bastian Wagner
2026-08-17 14:33:28 +02:00
parent acfbb3ab22
commit ec95a8e527
17 changed files with 513 additions and 50 deletions

View File

@@ -0,0 +1,23 @@
exports.up = (pgm) => {
pgm.createTable('trip_settings', {
trip_id: {
type: 'uuid',
primaryKey: true,
notNull: true,
references: 'trips(id)',
onDelete: 'CASCADE',
},
web_research_enabled: { type: 'boolean', notNull: true, default: false },
periodic_agent_review_enabled: { type: 'boolean', notNull: true, default: false },
notification_email_enabled: { type: 'boolean', notNull: true, default: true },
notification_push_enabled: { type: 'boolean', notNull: true, default: true },
default_research_depth: { type: 'text' },
default_planning_style: { type: 'text' },
created_at: { type: 'timestamptz', notNull: true, default: pgm.func('now()') },
updated_at: { type: 'timestamptz', notNull: true, default: pgm.func('now()') },
});
};
exports.down = (pgm) => {
pgm.dropTable('trip_settings');
};