Skip to content

SQL Database

ottpeter edited this page Oct 28, 2022 · 1 revision

SQL Database

Our SQL database is a PostgreSQL database. These are the tables that we currently have:

  • contracts - Currently we manually add new contracts here. This table tells as which minting contracts exist in our system. Later, the contracts would be owned by a DAO (probably modified Sputnik), but we don't have that yet.
  • nft_thumbnails - Stores compressed NFT images as Base64. This route will fill up this table. This is not automatically done.
  • nfts_by_owner - Tells us which NFT is owned by which user. This is necessary, because otherwise we would need to collect this data across all the contracts at every display. This route will fill up this table, and there are other routes as well that are doing smaller updates, these are the updates that should happen at NFT-Buy or NFT-Transfer events.
  • collaborators - ArtistList. Stored in stringified JSON. Currently it is double stringified, by mistake, we either fix all of them, or remember that we need to do JSON.parse() two times. This is manually filled, but the Admin panel now creates this string and stores it in the artistList folder on the server.

This file shows how the tables were created. We update this file each time we add a new table.
Credentials for the database are in .env.

Clone this wiki locally