Polsia apps use Neon PostgreSQL. DATABASE_URL is automatically provided.
javascript
const { Pool } = require('pg');
const pool = new Pool({ connectionString: process.env.DATABASE_URL });
Create files in migrations/ with timestamp prefix: 1704067200000_add_products_table.js
javascript
module.exports = {
up: async (pool) => {
await pool.query(`CREATE TABLE products (...)`);
},
down: async (pool) => {
await pool.query(`DROP TABLE products`);
}
};