|
| 1 | +/** |
| 2 | + * @license |
| 3 | + * Copyright CERN and copyright holders of ALICE O2. This software is |
| 4 | + * distributed under the terms of the GNU General Public License v3 (GPL |
| 5 | + * Version 3), copied verbatim in the file "COPYING". |
| 6 | + * |
| 7 | + * See http://alice-o2.web.cern.ch/license for full licensing information. |
| 8 | + * |
| 9 | + * In applying this license CERN does not waive the privileges and immunities |
| 10 | + * granted to it by virtue of its status as an Intergovernmental Organization |
| 11 | + * or submit itself to any jurisdiction. |
| 12 | + */ |
| 13 | + |
| 14 | +module.exports = { |
| 15 | + up: (queryInterface, Sequelize) => queryInterface.createTable('runs', { |
| 16 | + id: { |
| 17 | + allowNull: false, |
| 18 | + autoIncrement: true, |
| 19 | + primaryKey: true, |
| 20 | + type: Sequelize.INTEGER, |
| 21 | + }, |
| 22 | + time_o2_start: { |
| 23 | + type: Sequelize.DATE, |
| 24 | + }, |
| 25 | + time_o2_end: { |
| 26 | + type: Sequelize.DATE, |
| 27 | + }, |
| 28 | + time_trg_start: { |
| 29 | + type: Sequelize.DATE, |
| 30 | + }, |
| 31 | + time_trg_end: { |
| 32 | + type: Sequelize.DATE, |
| 33 | + }, |
| 34 | + activity_id: { |
| 35 | + type: Sequelize.CHAR, |
| 36 | + }, |
| 37 | + run_type: { |
| 38 | + type: Sequelize.ENUM('physics', 'cosmics', 'technical'), |
| 39 | + }, |
| 40 | + run_quality: { |
| 41 | + type: Sequelize.ENUM('good', 'bad', 'unknown'), |
| 42 | + }, |
| 43 | + n_detectors: { |
| 44 | + type: Sequelize.INTEGER, |
| 45 | + }, |
| 46 | + n_flps: { |
| 47 | + type: Sequelize.INTEGER, |
| 48 | + }, |
| 49 | + n_epns: { |
| 50 | + type: Sequelize.INTEGER, |
| 51 | + }, |
| 52 | + n_subtimeframes: { |
| 53 | + type: Sequelize.INTEGER, |
| 54 | + }, |
| 55 | + bytes_read_out: { |
| 56 | + type: Sequelize.INTEGER, |
| 57 | + }, |
| 58 | + bytes_timeframe_builder: { |
| 59 | + type: Sequelize.INTEGER, |
| 60 | + }, |
| 61 | + created_at: { |
| 62 | + allowNull: false, |
| 63 | + type: Sequelize.DATE, |
| 64 | + defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'), |
| 65 | + }, |
| 66 | + updated_at: { |
| 67 | + allowNull: false, |
| 68 | + type: Sequelize.DATE, |
| 69 | + defaultValue: Sequelize.literal('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), |
| 70 | + }, |
| 71 | + }), |
| 72 | + |
| 73 | + down: (queryInterface, _Sequelize) => queryInterface.dropTable('runs'), |
| 74 | +}; |
0 commit comments