@atlantjs/backend 4.0.26 → 4.0.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/backend/application/databases/database.config.d.ts +4 -5
- package/backend/application/databases/database.config.js +5 -4
- package/backend/application/databases/database.helper.abstract.d.ts +1 -1
- package/backend/application/databases/database.helper.abstract.js +1 -1
- package/backend/application/env/env-vars.d.ts +1 -0
- package/backend/application/env/env-vars.js +8 -2
- package/package.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -5,11 +5,10 @@ interface DatabaseConfigProps {
|
|
|
5
5
|
port: number;
|
|
6
6
|
username: string;
|
|
7
7
|
password: string;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
migrations?: string[];
|
|
8
|
+
databaseName: string;
|
|
9
|
+
databaseSchemaName: string;
|
|
10
|
+
schemas: string[];
|
|
11
|
+
migrations: string[];
|
|
13
12
|
region?: string;
|
|
14
13
|
secretArn?: string;
|
|
15
14
|
resourceArn?: string;
|
|
@@ -21,10 +21,11 @@ class DatabaseConfigAbstract {
|
|
|
21
21
|
port: this.props.port,
|
|
22
22
|
username: this.props.username,
|
|
23
23
|
password: this.props.password,
|
|
24
|
-
database: this.props.
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
database: this.props.databaseName,
|
|
25
|
+
schema: this.props.databaseSchemaName,
|
|
26
|
+
synchronize: env_vars_1.DATABASE_AUTOMATICALLY_CREATE_TABLES_ENABLED,
|
|
27
|
+
entities: this.props.schemas,
|
|
28
|
+
migrations: this.props.migrations,
|
|
28
29
|
};
|
|
29
30
|
if (arch_1._.isEqual(this.props.type, "aurora-mysql")) {
|
|
30
31
|
Object.assign(baseConfig, {
|
|
@@ -52,7 +52,7 @@ class DatabaseHelperAbstract {
|
|
|
52
52
|
await repository.update({ id: schemaEntity.entity.id.toString() }, schemaEntity.entity.toSchema());
|
|
53
53
|
}
|
|
54
54
|
ids.push({
|
|
55
|
-
schema: schemaEntity.schema
|
|
55
|
+
schema: schemaEntity.schema,
|
|
56
56
|
id: schemaEntity.entity.id.toString(),
|
|
57
57
|
});
|
|
58
58
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { NodeEnvs } from "@atlantjs/arch";
|
|
2
2
|
export declare const APP_PORT: string;
|
|
3
|
+
export declare const DATABASE_AUTOMATICALLY_CREATE_TABLES_ENABLED: boolean;
|
|
3
4
|
export declare const DATABASE_SSL_ENABLED: boolean;
|
|
4
5
|
export declare const LOAD_MODULES: string;
|
|
5
6
|
export declare const CORS_ALLOWED_ORIGINS: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isProdOrHomolog = exports.ENVIRONMENT = exports.CORS_ALLOWED_ORIGINS = exports.LOAD_MODULES = exports.DATABASE_SSL_ENABLED = exports.APP_PORT = void 0;
|
|
3
|
+
exports.isProdOrHomolog = exports.ENVIRONMENT = exports.CORS_ALLOWED_ORIGINS = exports.LOAD_MODULES = exports.DATABASE_SSL_ENABLED = exports.DATABASE_AUTOMATICALLY_CREATE_TABLES_ENABLED = exports.APP_PORT = void 0;
|
|
4
4
|
const arch_1 = require("@atlantjs/arch");
|
|
5
5
|
const env_var_1 = require("../../../setup/env-var");
|
|
6
6
|
exports.APP_PORT = env_var_1.EnvVar.get({
|
|
@@ -8,8 +8,14 @@ exports.APP_PORT = env_var_1.EnvVar.get({
|
|
|
8
8
|
type: "port-number",
|
|
9
9
|
description: "The port number on which the application will run",
|
|
10
10
|
});
|
|
11
|
+
exports.DATABASE_AUTOMATICALLY_CREATE_TABLES_ENABLED = env_var_1.EnvVar.get({
|
|
12
|
+
isRequired: true,
|
|
13
|
+
name: "DATABASE_AUTOMATICALLY_CREATE_TABLES_ENABLED",
|
|
14
|
+
type: "boolean",
|
|
15
|
+
description: "Flag indicating whether the ORM automatically creates tables in the database based on .schema.ts files",
|
|
16
|
+
});
|
|
11
17
|
exports.DATABASE_SSL_ENABLED = env_var_1.EnvVar.get({
|
|
12
|
-
isRequired:
|
|
18
|
+
isRequired: true,
|
|
13
19
|
name: "DATABASE_SSL_ENABLED",
|
|
14
20
|
type: "boolean",
|
|
15
21
|
description: "Flag indicating whether the database requires an SSL connection",
|