mirror of
https://gitee.com/nocobase/nocobase.git
synced 2024-12-02 04:07:50 +08:00
fix: kingbase can not create sub-apps
This commit is contained in:
parent
fdee3f0afe
commit
c8ef1996c3
@ -77,7 +77,7 @@ const defaultDbCreator = async (app: Application) => {
|
||||
await connection.end();
|
||||
}
|
||||
|
||||
if (dialect === 'postgres') {
|
||||
if (['postgres', 'kingbase'].includes(dialect)) {
|
||||
const { Client } = require('pg');
|
||||
|
||||
const client = new Client({
|
||||
@ -85,7 +85,7 @@ const defaultDbCreator = async (app: Application) => {
|
||||
port,
|
||||
user: username,
|
||||
password,
|
||||
database: 'postgres',
|
||||
database: dialect,
|
||||
});
|
||||
|
||||
await client.connect();
|
||||
@ -113,7 +113,10 @@ const defaultAppOptionsFactory = (appName: string, mainApp: Application) => {
|
||||
const mainStorageDir = path.dirname(mainAppStorage);
|
||||
rawDatabaseOptions.storage = path.join(mainStorageDir, `${appName}.sqlite`);
|
||||
}
|
||||
} else if (process.env.USE_DB_SCHEMA_IN_SUBAPP === 'true' && mainApp.db.isPostgresCompatibleDialect()) {
|
||||
} else if (
|
||||
process.env.USE_DB_SCHEMA_IN_SUBAPP === 'true' &&
|
||||
['postgres', 'kingbase'].includes(rawDatabaseOptions.dialect)
|
||||
) {
|
||||
rawDatabaseOptions.schema = appName;
|
||||
} else {
|
||||
rawDatabaseOptions.database = appName;
|
||||
|
Loading…
Reference in New Issue
Block a user