mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 21:49:25 +08:00
fix(plugin-workflow-manual): fix migration version (#6430)
This commit is contained in:
parent
ddbb62ed49
commit
9a2b877a97
@ -7,13 +7,11 @@
|
|||||||
* For more information, please refer to: https://www.nocobase.com/agreement.
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { createMockServer, MockServer } from '@nocobase/test';
|
import { createMockServer } from '@nocobase/test';
|
||||||
import { describe, test } from 'vitest';
|
import { describe, test } from 'vitest';
|
||||||
import workflowManualTasks from '../../collections/workflowManualTasks';
|
import workflowManualTasks from '../../collections/workflowManualTasks';
|
||||||
import Migration from '../../migrations/20250312100512-change-table-name';
|
import Migration from '../../migrations/20250312100512-change-table-name';
|
||||||
|
|
||||||
const pgOnly = (schema) => (schema && process.env.DB_DIALECT == 'postgres' ? it : it.skip);
|
|
||||||
|
|
||||||
const matrix: [string, string][] = [
|
const matrix: [string, string][] = [
|
||||||
// schema, tablePrefix
|
// schema, tablePrefix
|
||||||
[undefined, undefined],
|
[undefined, undefined],
|
||||||
@ -24,7 +22,10 @@ const matrix: [string, string][] = [
|
|||||||
|
|
||||||
function matrixTest() {
|
function matrixTest() {
|
||||||
for (const [schema, tablePrefix] of matrix) {
|
for (const [schema, tablePrefix] of matrix) {
|
||||||
pgOnly(schema)(`schema: ${schema}, tablePrefix: ${tablePrefix}`, async () => {
|
if (schema && process.env.DB_DIALECT !== 'postgres') {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
test(`schema: ${schema}, tablePrefix: ${tablePrefix}`, async () => {
|
||||||
const app = await createMockServer({
|
const app = await createMockServer({
|
||||||
database: {
|
database: {
|
||||||
schema,
|
schema,
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
import { Migration } from '@nocobase/server';
|
import { Migration } from '@nocobase/server';
|
||||||
|
|
||||||
export default class extends Migration {
|
export default class extends Migration {
|
||||||
appVersion = '<1.6.2';
|
appVersion = '<1.7.0';
|
||||||
on = 'beforeLoad';
|
on = 'beforeLoad';
|
||||||
async up() {
|
async up() {
|
||||||
const { db } = this.context;
|
const { db } = this.context;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user