Skip to content

Commit

Permalink
Merge pull request #542 from namecheap/feature/pg-schema
Browse files Browse the repository at this point in the history
Feature/pg schema
  • Loading branch information
stas-nc authored Nov 3, 2023
2 parents 0f6fa31 + 8c69782 commit c6a0d9e
Show file tree
Hide file tree
Showing 9 changed files with 234 additions and 1,099 deletions.
1,125 changes: 114 additions & 1,011 deletions ilc/package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions ilc/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"author": "",
"license": "Apache-2.0",
"dependencies": {
"@namecheap/error-extender": "^1.2.0",
"@namecheap/tailorx": "^7.0.1",
"@namecheap/error-extender": "^2.0.0",
"@namecheap/tailorx": "^8.0.0",
"@newrelic/native-metrics": "^10.0.1",
"agentkeepalive": "^4.5.0",
"axios": "^0.21.4",
Expand All @@ -34,8 +34,8 @@
"eventemitter3": "^5.0.1",
"fast-glob": "^3.3.1",
"fastify": "^2.15.2",
"ilc-plugins-sdk": "^1.7.0",
"ilc-sdk": "^4.0.7",
"ilc-plugins-sdk": "^2.0.2",
"ilc-sdk": "^5.0.0",
"is-url": "^1.2.4",
"js-cookie": "^2.2.1",
"lodash": "^4.17.21",
Expand Down
2 changes: 1 addition & 1 deletion ilc/server/i18n.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const parseUrl = require('parseurl');
const Cookie = require('cookie');
const IlcIntl = require('ilc-sdk/app').IlcIntl;
const { intlSchema } = require('ilc-sdk/dist/server/IlcProtocol'); // "Private" import
const { intlSchema } = require('ilc-sdk');

const i18nCookie = require('../common/i18nCookie');

Expand Down
1 change: 1 addition & 0 deletions registry/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ DB_HOST=localhost
DB_USER=root
DB_PASSWORD=pwd
DB_NAME=ilc
DB_SEARCH_PATH=public
1 change: 1 addition & 0 deletions registry/config/custom-environment-variables.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export default {
database: 'DB_NAME',
filename: 'DB_FILENAME',
},
searchPath: 'DB_SEARCH_PATH',
rootPassword: 'ROOT_PWD',
},
auth: {
Expand Down
1 change: 1 addition & 0 deletions registry/config/default.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ module.exports = {
database: 'registry_db',
filename: path.resolve(__dirname, '../server/dbfiles/db.sqlite'),
},
searchPath: ['public'],
useNullAsDefault: true,
migrations: {
directory: path.resolve(__dirname, '../server/migrations'),
Expand Down
189 changes: 108 additions & 81 deletions registry/package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions registry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"tsc": "tsc",
"compile": "tsc --incremental",
"dev": "nodemon -e ts,json5 --exec \"npx tsc --incremental && dotenv -- npm run start | pino-pretty\" ",
"dev": "nodemon -e ts,json5 --exec \"npx tsc --incremental && dotenv -- npm run start\" ",
"build": "npm run compile && cd ./client && npm run build",
"start": "node -r source-map-support/register ./build/server/index.js",
"start-docker": "npm run migrate && npm start",
Expand Down Expand Up @@ -77,7 +77,7 @@
"express": "^4.18.2",
"express-session": "^1.17.3",
"http-shutdown": "^1.2.2",
"ilc-plugins-sdk": "^1.7.0",
"ilc-plugins-sdk": "^2.0.2",
"is-valid-domain": "0.1.6",
"joi": "^17.11.0",
"knex": "^3.0.1",
Expand Down
2 changes: 2 additions & 0 deletions registry/server/db/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ import { syncSequencePlugin } from './syncSequence';
import { cascadeTruncatePlugin } from './cascadeTruncate';

const client: string = config.get('database.client');
const searchPath: string = config.get('database.searchPath');
const connectionConfig: Knex.StaticConnectionConfig = config.get('database.connection');

export const knexConfig: Knex.Config = {
client,
connection: { ...connectionConfig },
searchPath,
/**
* Sqlite does not support inserting default values
* That is why we added it
Expand Down

0 comments on commit c6a0d9e

Please sign in to comment.