This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This script migrates a PostgreSQL database to a Cloudflare D1 database. | |
# Put this script in the ./scripts directory of your project. | |
# To run it, CD into the ./scripts directory and run: | |
# ./psql-to-d1.sh | |
# If the file is not executable, you can make it executable with: | |
# chmod +x psql-to-d1.sh | |
# Define your D1_DATABASE_NAME and POSTGRES_CONN_STRING environment variables in a .env.scripts file. |