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