Todos os dias

Todos os dias te olho e tenho medo. É verdade, sou mesmo medroso. Tenho medo por não saber pra onde você vai, nem o que quer, nem como devo agir. Tenho medo de que você suma de repente de minha vida…

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




Delete an application on the Azure Blockchain Workbench

One of the biggest problem in our development workflow was the impossibility to delete an application from the workbench UI. Given the fact that each application name must be unique, you must rename your application at each deployment, this leads to a very repetitive task and an overflown dashboard as shown in the picture below.

I tried to work on a quick fix until the “delete application” functionality gets implemented (there is already an API endpoint described in the Swagger metadata, but it throws a not implemented exception at the time of writing). The application is displayed because it is in the “Application” table of the Workbench’s SQL database. I tried to remove it but by default it is not possible as there are a foreign keys dependency on a lot of other tables. So, I just analyzed the table and built the following script in order to relax those constraint and enable to delete applications:

By using this script, your contract will still be in your Ethereum blockchain, and you could still interact with them using geth or web3. But they won’t be surfaced anymore to the workbench and hence invisible from the UI or API. Note that this script will drop your foreign key constraints and recreate them with a CASCADE delete enabled. This means that any delete operations will be carried across table and won’t be restricted by your foreign keys anymore and hence carry a risk in miss deleting some of your dependencies. A safer way of doing this would be to write a stored procedure that would delete the rows in the correct order, but the above solution proved good enough for me.

Add a comment

Related posts:

Positive Reflection

In one of the session, We had to make a presentation on “Toat”. We have to make a visual representation on a chart. This a task that I personally have never performed. Our target was to come up with…

Did James Comey Induce a Special Counsel to Save Himself?

It is undeniable. James Comey’s FBI interfered in the 2016 election on the side of the Obama administration and Hillary Clinton. His actions so obviously political in nature, begs the question. Did…

A Book Reading Event for This International Literacy Day

A bell rang in my head as soon as I received an email from Pratham Books to become a #PBChamp and conduct a book reading event for children this International Literacy Day. The folks at Pratham Books…