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,24 @@
exports.up = (pgm) => {
pgm.createTable('user_preferences', {
user_id: {
type: 'uuid',
primaryKey: true,
notNull: true,
references: 'users(id)',
onDelete: 'CASCADE',
},
preferred_pace: { type: 'text' },
preferred_budget_level: { type: 'text' },
max_walking_distance_km: { type: 'numeric' },
preferred_start_time: { type: 'text' },
child_friendly_preferred: { type: 'boolean', notNull: true, default: false },
interests: { type: 'text[]', notNull: true, default: '{}' },
notes: { 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('user_preferences');
};