Files
gnommoeditor/backend/migrations/010_create_citations.cjs
T

14 lines
556 B
JavaScript
Raw Normal View History

2026-04-11 09:24:21 +02:00
exports.up = (pgm) => {
pgm.createTable('citations', {
id: 'id',
project_id: { type: 'integer', notNull: true, references: 'videos', onDelete: 'CASCADE' },
reference: { type: 'text', notNull: true },
context: { type: 'text' },
sort_order: { type: 'integer', notNull: true, default: 0 },
created_at: { type: 'timestamptz', notNull: true, default: pgm.func('NOW()') },
});
pgm.createIndex('citations', 'project_id', { name: 'idx_citations_project_id' });
};
exports.down = (pgm) => { pgm.dropTable('citations'); };