-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy path20260223120000-create-gaq-summary-tables.js
More file actions
71 lines (68 loc) · 2.35 KB
/
Copy path20260223120000-create-gaq-summary-tables.js
File metadata and controls
71 lines (68 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
'use strict';
/** @type {import('sequelize-cli').Migration} */
module.exports = {
up: async (queryInterface, Sequelize) => queryInterface.sequelize.transaction(async (transaction) => {
await queryInterface.createTable('gaq_summaries', {
data_pass_id: {
type: Sequelize.INTEGER,
primaryKey: true,
allowNull: false,
references: {
model: 'data_passes',
key: 'id',
},
},
run_number: {
type: Sequelize.INTEGER,
primaryKey: true,
allowNull: false,
references: {
model: 'runs',
key: 'run_number',
},
},
bad_run_coverage: {
type: Sequelize.FLOAT,
},
explicitly_not_bad_run_coverage: {
type: Sequelize.FLOAT,
},
mc_reproducible_coverage: {
type: Sequelize.FLOAT,
},
missing_verifications_count: {
type: Sequelize.INTEGER,
},
undefined_quality_periods_count: {
type: Sequelize.INTEGER,
},
not_computable: {
type: Sequelize.BOOLEAN,
allowNull: false,
defaultValue: false,
},
invalidated_at: {
type: Sequelize.DATE(3),
allowNull: true,
defaultValue: null,
},
created_at: {
type: Sequelize.DATE(3),
allowNull: false,
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP(3)'),
},
updated_at: {
type: Sequelize.DATE(3),
allowNull: false,
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP(3) ON UPDATE CURRENT_TIMESTAMP(3)'),
},
}, { transaction });
await queryInterface.addIndex('gaq_summaries', {
name: 'gaq_summaries_invalidated_at_idx',
fields: ['invalidated_at'],
}, { transaction });
}),
down: async (queryInterface) => queryInterface.sequelize.transaction(async (transaction) => {
await queryInterface.dropTable('gaq_summaries', { transaction });
}),
};