一般的问题是,如果将来通过添加没有数据库支持的代码来更改模型,迁移可能会失败。
这个场景类似于:我有一个这样的迁移:
def change
Product.find_each do |product|
product.prices.each do |price|
price.supplier_part_number = product.supplier_part_number
price.save
end
end
end
将迁移部署到暂存。然后将一个状态机添加到需要state属性的Price模型中。add_state迁移被部署到staging,因
所以我创建了一个令牌tokenA
contract tokenA is ERC20 {
address public deployer; //to save adress of the deployer
constructor() ERC20('tokenA', 'TA') { //called by the deployer (once)
_mint(msg.sender, 1000000000000 * 10 ** 10); //mint/create tokens - we have created 1000000