feat: add versioned migrations and kysely query layer
This commit is contained in:
24
backend/migrations/1700000002000_create-user-preferences.cjs
Normal file
24
backend/migrations/1700000002000_create-user-preferences.cjs
Normal 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');
|
||||
};
|
||||
Reference in New Issue
Block a user