- CitrineOS core extracted (CSMS OCPP 2.0.1) - OpenOCPP extracted (firmware OCPP 1.6J/2.0.1) - ShapeShifter library installed (pip install -e) - ShapeShifter specification extracted - EVerest extracted TODO updated with progress
40 lines
1.4 KiB
TypeScript
40 lines
1.4 KiB
TypeScript
// SPDX-FileCopyrightText: 2026 Contributors to the CitrineOS Project
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
'use strict';
|
|
|
|
/** @type {import('sequelize-cli').Migration} */
|
|
import { DataTypes, QueryInterface } from 'sequelize';
|
|
|
|
export default {
|
|
up: async (queryInterface: QueryInterface) => {
|
|
// Check if columns already exist
|
|
const table = await queryInterface.describeTable('ServerNetworkProfiles');
|
|
|
|
// Add dynamicTenantResolution column if it doesn't exist
|
|
if (!table.dynamicTenantResolution) {
|
|
await queryInterface.addColumn('ServerNetworkProfiles', 'dynamicTenantResolution', {
|
|
type: DataTypes.BOOLEAN,
|
|
allowNull: false,
|
|
defaultValue: false,
|
|
comment: 'Enable dynamic tenant resolution at WebSocket upgrade time',
|
|
});
|
|
}
|
|
|
|
// Add maxConnectionsPerTenant column if it doesn't exist
|
|
if (!table.maxConnectionsPerTenant) {
|
|
await queryInterface.addColumn('ServerNetworkProfiles', 'maxConnectionsPerTenant', {
|
|
type: DataTypes.INTEGER,
|
|
allowNull: true,
|
|
comment: 'Maximum number of concurrent connections allowed per tenant',
|
|
});
|
|
}
|
|
},
|
|
|
|
down: async (queryInterface: QueryInterface) => {
|
|
// Rollback: remove the columns
|
|
await queryInterface.removeColumn('ServerNetworkProfiles', 'dynamicTenantResolution');
|
|
await queryInterface.removeColumn('ServerNetworkProfiles', 'maxConnectionsPerTenant');
|
|
},
|
|
};
|