I would like to execute migration file "6_deploy_and_register_group.js" every time when I need to create a new group. Is this a proper way to use migrations? If yes, how can I make it working? Calling:
truffle migrate 6_deploy_and_register_group.js
gives me that "network is up to date". Is there any way to execute only that file but have stored other addresses unchanged?
2_deploy_registry.js:
var Registry = artifacts.require('./Registry');
module.exports = async function(deployer, network, accounts)
{
await deployer.deploy(Registry);
};
6_deploy_and_register_group.js:
var Group = artifacts.require('./Group');
var Registry = artifacts.require('./Registry');
const args = require('minimist')(process.argv.slice(2));
module.exports = async function(deployer, network, accounts)
{
let units = args["itemscount"];
if(units == null)
{
console.log('\x1b[31m%s\x1b[0m', 'did you forget to use --itemscount=xyz argument?');
}
let groupName = args["groupname"];
if(groupName == null)
{
console.log('\x1b[31m%s\x1b[0m', 'did you forget to use --groupname=xyz argument?');
}
await deployer.deploy(Group, groupName, units);
let registry = await Registry.deployed();
await registry.register(Group.address);
};