|
| 1 | +/* |
| 2 | + * Graphile Migrate configuration. |
| 3 | + * |
| 4 | + * This file is version tracked, do not add any secrets (passwords, etc) to it |
| 5 | + * - manage these with environmental variables instead. |
| 6 | + * |
| 7 | + * This file is in JSON5 format, in VSCode you can use "JSON with comments" as |
| 8 | + * the file format. |
| 9 | + */ |
| 10 | + |
| 11 | +{ |
| 12 | + /* |
| 13 | + * Database connections strings are sourced from the DATABASE_URL, |
| 14 | + * SHADOW_DATABASE_URL and ROOT_DATABASE_URL environmental variables. |
| 15 | + */ |
| 16 | + |
| 17 | + /* |
| 18 | + * pgSettings: key-value settings to be automatically loaded into PostgreSQL |
| 19 | + * before running migrations, using an equivalent of `SET LOCAL <key> TO |
| 20 | + * <value>` |
| 21 | + */ |
| 22 | + "pgSettings": { |
| 23 | + "search_path": "app_public,app_private,app_hidden,public" |
| 24 | + }, |
| 25 | + |
| 26 | + /* |
| 27 | + * placeholders: substituted in SQL files when compiled/executed. Placeholder |
| 28 | + * keys should be prefixed with a colon and in all caps, like |
| 29 | + * `:COLON_PREFIXED_ALL_CAPS`. Placeholder values should be strings. They |
| 30 | + * will be replaced verbatim with NO ESCAPING AT ALL (this differs from how |
| 31 | + * psql handles placeholders) so should only be used with "safe" values. This |
| 32 | + * is useful for committing migrations where certain parameters can change |
| 33 | + * between environments (development, staging, production) but you wish to |
| 34 | + * use the same signed migration files for all. |
| 35 | + * |
| 36 | + * The special value "!ENV" can be used to indicate an environmental variable |
| 37 | + * of the same name should be used. |
| 38 | + * |
| 39 | + * Graphile Migrate automatically sets the `:DATABASE_NAME` and |
| 40 | + * `:DATABASE_OWNER` placeholders, and you should not attempt to override |
| 41 | + * these. |
| 42 | + */ |
| 43 | + "placeholders": { |
| 44 | + ":DATABASE_AUTHENTICATOR": "!ENV", |
| 45 | + ":DATABASE_VISITOR": "!ENV" |
| 46 | + }, |
| 47 | + |
| 48 | + /* |
| 49 | + * Actions allow you to run scripts or commands at certain points in the |
| 50 | + * migration lifecycle. SQL files are ran against the database directly. |
| 51 | + * "command" actions are ran with the following environmental variables set: |
| 52 | + * |
| 53 | + * - GM_DBURL: the PostgreSQL URL of the database being migrated |
| 54 | + * - GM_DBNAME: the name of the database from GM_DBURL |
| 55 | + * - GM_DBUSER: the user from GM_DBURL |
| 56 | + * - GM_SHADOW: set to 1 if the shadow database is being migrated, left unset |
| 57 | + * otherwise |
| 58 | + * |
| 59 | + * If "shadow" is unspecified, the actions will run on events to both shadow |
| 60 | + * and normal databases. If "shadow" is true the action will only run on |
| 61 | + * actions to the shadow DB, and if false only on actions to the main DB. |
| 62 | + */ |
| 63 | + |
| 64 | + /* |
| 65 | + * afterReset: actions executed after a `graphile-migrate reset` command. |
| 66 | + */ |
| 67 | + "afterReset": [ |
| 68 | + "!afterReset.sql", |
| 69 | + ], |
| 70 | + |
| 71 | + /* |
| 72 | + * afterAllMigrations: actions executed once all migrations are complete. |
| 73 | + */ |
| 74 | + "afterAllMigrations": [ |
| 75 | + // { |
| 76 | + // "_": "command", |
| 77 | + // "shadow": false, |
| 78 | + // "command": "node scripts/dump-db.js" |
| 79 | + // } |
| 80 | + ], |
| 81 | + |
| 82 | + /* |
| 83 | + * afterCurrent: actions executed once the current migration has been |
| 84 | + * evaluated (i.e. in watch mode). |
| 85 | + */ |
| 86 | + "afterCurrent": [ |
| 87 | + // { |
| 88 | + // "_": "command", |
| 89 | + // "shadow": false, |
| 90 | + // "command": "" |
| 91 | + // } |
| 92 | + ], |
| 93 | + |
| 94 | + /* |
| 95 | + * blankMigrationContent: content to be written to the current migration |
| 96 | + * after commit. NOTE: this should only contain comments. |
| 97 | + */ |
| 98 | + // "blankMigrationContent": "", |
| 99 | + |
| 100 | + /****************************************************************************\ |
| 101 | + *** *** |
| 102 | + *** You probably don't want to edit anything below here. *** |
| 103 | + *** *** |
| 104 | + \****************************************************************************/ |
| 105 | + |
| 106 | + /* |
| 107 | + * manageGraphileMigrateSchema: if you set this false, you must be sure to |
| 108 | + * keep the graphile_migrate schema up to date yourself. We recommend you |
| 109 | + * leave it at its default. |
| 110 | + */ |
| 111 | + // "manageGraphileMigrateSchema": true, |
| 112 | + |
| 113 | + /* |
| 114 | + * migrationsFolder: path to the folder in which to store your migrations. |
| 115 | + */ |
| 116 | + // migrationsFolder: "./migrations", |
| 117 | + |
| 118 | + "//generatedWith": "0.1.0" |
| 119 | +} |
0 commit comments