https://github.com/web3-storage/web3-schema
https://github.com/web3-storage/web3-schema
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/web3-storage/web3-schema
- Owner: web3-storage
- Archived: true
- Created: 2021-08-26T10:47:52.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2021-09-06T10:51:55.000Z (almost 5 years ago)
- Last Synced: 2025-02-24T00:28:04.075Z (over 1 year ago)
- Size: 19.5 KB
- Stars: 3
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# web3.storage sql schema experiments
Experiments converting web3.storage [fauna database schema](https://github.com/web3-storage/web3.storage/blob/main/packages/db/fauna/schema.graphql) into postgresql.
Schema design is based on [this](https://bafybeieevwz3ubli22dra5dnjp5w2gvuc54y6bpf67p3xikeracokttp2m.ipfs.dweb.link/web3.storage-schema.jpg) image, not exactly matching the current fauna schema.
[](https://bafybeieevwz3ubli22dra5dnjp5w2gvuc54y6bpf67p3xikeracokttp2m.ipfs.dweb.link/web3.storage-schema.jpg)
To set up a database locally, first create a new database:
```shell
createdb web3_storage
```
Then apply the schema to it:
```shell
psql -d web3_storage < schema.sql
```
### Heroku and PostgREST
This repo also contains the config to deploy PostgREST to heroku on top of the new schema.
To deploy to your existing heroku app with postgresql addon via the cli:
```shell
heroku pg:psql DATABASE < schema.sql
```
To set up a new heroku app run, hit the button below:
[](https://heroku.com/deploy)
This will create a new heroku project with postgresql addon and PostgREST configured.