authenticvision / digitalsoul

MetaAnchor-Framework for self-hosting
MIT License
2 stars 0 forks source link

Baseline and create explicit NFT to Assets relationship table #57

Closed pedrolucasp closed 9 months ago

pedrolucasp commented 10 months ago

This PR creates a new explicit join table that'll hold the assets and nft relationship, while also baselining the current state of the DB. This will help us to keep using migrations going forward and avoid at all costs "pushing" out the schema.

This table requires a manual intervention, this script must run inside the database container after copying it; This script copies the data present on the implicit table to the new one explicitly. After the rollout of this intervention, I'll patch it out of the old, implicit table. This is only due to the fact that Prisma doesn't have data migrations.


INSERT INTO assets_nfts (asset_id, nft_id, asset_type) SELECT "A", "B", assets.asset_type FROM "_AssetToNFT"
    INNER JOIN assets ON "_AssetToNFT"."A" = assets.id
;
tbergmueller commented 9 months ago

I pulled these changes into #60 and merged it together (as there was linear git history)