mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 13:39:24 +08:00
Merge remote-tracking branch 'origin/main' into next
This commit is contained in:
commit
548cfe3e56
@ -127,6 +127,8 @@ describe('view inference', function () {
|
||||
});
|
||||
|
||||
const createdAt = UserCollection.model.rawAttributes['createdAt'].field;
|
||||
expect(inferredFields[createdAt]['field']).toBeDefined();
|
||||
|
||||
if (db.isMySQLCompatibleDialect()) {
|
||||
expect(inferredFields[createdAt]['type']).toBe('datetimeNoTz');
|
||||
} else {
|
||||
|
@ -52,7 +52,7 @@ export class ViewFieldInference {
|
||||
const rawFields = [];
|
||||
|
||||
for (const [name, column] of Object.entries(columns)) {
|
||||
const inferResult: any = { name, rawType: column.type };
|
||||
const inferResult: any = { name, rawType: column.type, field: name };
|
||||
|
||||
const usage = columnUsage[name];
|
||||
|
||||
|
@ -450,7 +450,7 @@ describe('view collection', function () {
|
||||
|
||||
const dropViewSQL = `DROP VIEW IF EXISTS test_view`;
|
||||
await db.sequelize.query(dropViewSQL);
|
||||
const viewSQL = `CREATE VIEW test_view AS select 1+1 as "Uppercase"`;
|
||||
const viewSQL = `CREATE VIEW test_view AS select 1+1 as "t_Uppercase"`;
|
||||
await db.sequelize.query(viewSQL);
|
||||
|
||||
await collectionRepository.create({
|
||||
@ -458,7 +458,7 @@ describe('view collection', function () {
|
||||
name: 'view_collection',
|
||||
viewName: 'test_view',
|
||||
isView: true,
|
||||
fields: [{ type: 'string', name: 'upper_case', field: 'Uppercase' }],
|
||||
fields: [{ type: 'string', name: 'upper_case', field: 't_Uppercase' }],
|
||||
schema: db.inDialect('postgres') ? 'public' : undefined,
|
||||
},
|
||||
context: {},
|
||||
@ -466,7 +466,7 @@ describe('view collection', function () {
|
||||
|
||||
const viewCollection = db.getCollection('view_collection');
|
||||
|
||||
expect(viewCollection.model.rawAttributes['upper_case'].field).toEqual('Uppercase');
|
||||
expect(viewCollection.model.rawAttributes['upper_case'].field).toEqual('t_Uppercase');
|
||||
const results = await viewCollection.repository.find();
|
||||
expect(results.length).toBe(1);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user