Skip to content

Commit

Permalink
feat: added tags
Browse files Browse the repository at this point in the history
  • Loading branch information
Nino van Galen committed May 8, 2020
1 parent 0705aae commit bce046f
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ module.exports = {
created_at: {
allowNull: false,
type: Sequelize.DATE,
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'),
},
updated_at: {
allowNull: false,
type: Sequelize.DATE,
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'),
},
}),

Expand Down
39 changes: 39 additions & 0 deletions lib/database/migrations/20200507230653-create-log-tags.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* @license
* Copyright CERN and copyright holders of ALICE O2. This software is
* distributed under the terms of the GNU General Public License v3 (GPL
* Version 3), copied verbatim in the file "COPYING".
*
* See http://alice-o2.web.cern.ch/license for full licensing information.
*
* In applying this license CERN does not waive the privileges and immunities
* granted to it by virtue of its status as an Intergovernmental Organization
* or submit itself to any jurisdiction.
*/

module.exports = {
up: (queryInterface, Sequelize) => queryInterface.createTable('log_tags', {
log_id: {
primaryKey: true,
allowNull: false,
type: Sequelize.INTEGER,
},
tag_id: {
primaryKey: true,
allowNull: false,
type: Sequelize.INTEGER,
},
created_at: {
allowNull: false,
type: Sequelize.DATE,
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'),
},
updated_at: {
allowNull: false,
type: Sequelize.DATE,
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'),
},
}),

down: (queryInterface, _Sequelize) => queryInterface.dropTable('log_tags'),
};
39 changes: 39 additions & 0 deletions lib/database/migrations/20200508120618-create-run_tags.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
/**
* @license
* Copyright CERN and copyright holders of ALICE O2. This software is
* distributed under the terms of the GNU General Public License v3 (GPL
* Version 3), copied verbatim in the file "COPYING".
*
* See http://alice-o2.web.cern.ch/license for full licensing information.
*
* In applying this license CERN does not waive the privileges and immunities
* granted to it by virtue of its status as an Intergovernmental Organization
* or submit itself to any jurisdiction.
*/

module.exports = {
up: (queryInterface, Sequelize) => queryInterface.createTable('run_tags', {
run_id: {
primaryKey: true,
allowNull: false,
type: Sequelize.INTEGER,
},
tag_id: {
primaryKey: true,
allowNull: false,
type: Sequelize.INTEGER,
},
created_at: {
allowNull: false,
type: Sequelize.DATE,
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP'),
},
updated_at: {
allowNull: false,
type: Sequelize.DATE,
defaultValue: Sequelize.literal('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'),
},
}),

down: (queryInterface, _Sequelize) => queryInterface.dropTable('run_tags'),
};

0 comments on commit bce046f

Please sign in to comment.