This folder contains SQL scripts and configuration files for setting up and managing the Supabase database for Drupal.js.
init.sql: Initial database setup scriptfunctions.sql: Custom PostgreSQL functionstriggers.sql: Database triggersroles.sql: Database roles and permissionsindexes.sql: Index definitions for performance optimizationmigrations/: Folder containing numbered migration scripts
- Connect to your Supabase project using the SQL Editor.
- Run the scripts in the following order:
init.sqlfunctions.sqltriggers.sqlroles.sqlindexes.sql
- Apply any migrations in the
migrations/folder in numerical order.
When making changes to the database schema, create a new migration file in the migrations/ folder with a timestamp prefix, e.g., 20230401000000_add_new_table.sql.
- Always backup your database before running any scripts.
- Test scripts in a development environment before applying to production.
- Keep this folder up-to-date with any manual changes made to the database.