25 lines
807 B
JavaScript
25 lines
807 B
JavaScript
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');
|
|
};
|