Storing data from my embeded app

Hey Tim!
I want to add a database to my embedded app.

metafields didn’t work for me.

I want to enable the button on adding the scripttag in the store and disable it if I remove scripttag. The enable and disable setting for every store, I want to save in database.
Please guide me.

Thanks in advance.!