Renamings
This commit is contained in:
parent
b60105f546
commit
ff8a4b420d
|
@ -211,9 +211,9 @@ describe("row api - postgres", () => {
|
||||||
async function createPrimaryRow(opts: {
|
async function createPrimaryRow(opts: {
|
||||||
rowData: PrimaryRowData
|
rowData: PrimaryRowData
|
||||||
createForeignRows?: {
|
createForeignRows?: {
|
||||||
createOne2Many?: boolean
|
createOneToMany?: boolean
|
||||||
createMany2One?: number
|
createManyToOne?: number
|
||||||
createMany2Many?: number
|
createManyToMany?: number
|
||||||
}
|
}
|
||||||
}) {
|
}) {
|
||||||
let { rowData } = opts as any
|
let { rowData } = opts as any
|
||||||
|
@ -238,7 +238,7 @@ describe("row api - postgres", () => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (opts?.createForeignRows?.createOne2Many) {
|
if (opts?.createForeignRows?.createOneToMany) {
|
||||||
const foreignKey = `fk_${oneToManyRelationshipInfo.table.name}_${oneToManyRelationshipInfo.fieldName}`
|
const foreignKey = `fk_${oneToManyRelationshipInfo.table.name}_${oneToManyRelationshipInfo.fieldName}`
|
||||||
|
|
||||||
const foreignRow = await config.createRow({
|
const foreignRow = await config.createRow({
|
||||||
|
@ -256,7 +256,7 @@ describe("row api - postgres", () => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i < (opts?.createForeignRows?.createMany2One || 0); i++) {
|
for (let i = 0; i < (opts?.createForeignRows?.createManyToOne || 0); i++) {
|
||||||
const foreignRow = await config.createRow({
|
const foreignRow = await config.createRow({
|
||||||
tableId: manyToOneRelationshipInfo.table._id,
|
tableId: manyToOneRelationshipInfo.table._id,
|
||||||
title: generator.name(),
|
title: generator.name(),
|
||||||
|
@ -274,7 +274,7 @@ describe("row api - postgres", () => {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i < (opts?.createForeignRows?.createMany2Many || 0); i++) {
|
for (let i = 0; i < (opts?.createForeignRows?.createManyToMany || 0); i++) {
|
||||||
const foreignRow = await config.createRow({
|
const foreignRow = await config.createRow({
|
||||||
tableId: manyToManyRelationshipInfo.table._id,
|
tableId: manyToManyRelationshipInfo.table._id,
|
||||||
title: generator.name(),
|
title: generator.name(),
|
||||||
|
@ -321,9 +321,9 @@ describe("row api - postgres", () => {
|
||||||
async function populatePrimaryRows(
|
async function populatePrimaryRows(
|
||||||
count: number,
|
count: number,
|
||||||
opts?: {
|
opts?: {
|
||||||
createOne2Many?: boolean
|
createOneToMany?: boolean
|
||||||
createMany2One?: number
|
createManyToOne?: number
|
||||||
createMany2Many?: number
|
createManyToMany?: number
|
||||||
}
|
}
|
||||||
) {
|
) {
|
||||||
return await Promise.all(
|
return await Promise.all(
|
||||||
|
@ -554,9 +554,9 @@ describe("row api - postgres", () => {
|
||||||
describe("with all relationship types", () => {
|
describe("with all relationship types", () => {
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
let [createdRow] = await populatePrimaryRows(1, {
|
let [createdRow] = await populatePrimaryRows(1, {
|
||||||
createOne2Many: true,
|
createOneToMany: true,
|
||||||
createMany2One: 3,
|
createManyToOne: 3,
|
||||||
createMany2Many: 2,
|
createManyToMany: 2,
|
||||||
})
|
})
|
||||||
row = createdRow.row
|
row = createdRow.row
|
||||||
rowData = createdRow.rowData
|
rowData = createdRow.rowData
|
||||||
|
@ -590,7 +590,7 @@ describe("row api - postgres", () => {
|
||||||
describe("with only one to many", () => {
|
describe("with only one to many", () => {
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
let [createdRow] = await populatePrimaryRows(1, {
|
let [createdRow] = await populatePrimaryRows(1, {
|
||||||
createOne2Many: true,
|
createOneToMany: true,
|
||||||
})
|
})
|
||||||
row = createdRow.row
|
row = createdRow.row
|
||||||
rowData = createdRow.rowData
|
rowData = createdRow.rowData
|
||||||
|
@ -621,7 +621,7 @@ describe("row api - postgres", () => {
|
||||||
describe("with only many to one", () => {
|
describe("with only many to one", () => {
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
let [createdRow] = await populatePrimaryRows(1, {
|
let [createdRow] = await populatePrimaryRows(1, {
|
||||||
createMany2One: 3,
|
createManyToOne: 3,
|
||||||
})
|
})
|
||||||
row = createdRow.row
|
row = createdRow.row
|
||||||
rowData = createdRow.rowData
|
rowData = createdRow.rowData
|
||||||
|
@ -650,7 +650,7 @@ describe("row api - postgres", () => {
|
||||||
describe("with only many to many", () => {
|
describe("with only many to many", () => {
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
let [createdRow] = await populatePrimaryRows(1, {
|
let [createdRow] = await populatePrimaryRows(1, {
|
||||||
createMany2Many: 2,
|
createManyToMany: 2,
|
||||||
})
|
})
|
||||||
row = createdRow.row
|
row = createdRow.row
|
||||||
rowData = createdRow.rowData
|
rowData = createdRow.rowData
|
||||||
|
@ -902,9 +902,9 @@ describe("row api - postgres", () => {
|
||||||
const rowsInfo = await createPrimaryRow({
|
const rowsInfo = await createPrimaryRow({
|
||||||
rowData,
|
rowData,
|
||||||
createForeignRows: {
|
createForeignRows: {
|
||||||
createOne2Many: true,
|
createOneToMany: true,
|
||||||
createMany2One: 3,
|
createManyToOne: 3,
|
||||||
createMany2Many: 2,
|
createManyToMany: 2,
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue