Rename rename test from mysql.spec.ts, it's covered in table.spec.ts
This commit is contained in:
parent
813d3e8d4e
commit
f2e3789ad2
|
@ -4,13 +4,7 @@ import {
|
||||||
MakeRequestResponse,
|
MakeRequestResponse,
|
||||||
} from "../api/routes/public/tests/utils"
|
} from "../api/routes/public/tests/utils"
|
||||||
import * as setup from "../api/routes/tests/utilities"
|
import * as setup from "../api/routes/tests/utilities"
|
||||||
import {
|
import { Datasource, FieldType, Table, TableSourceType } from "@budibase/types"
|
||||||
Datasource,
|
|
||||||
FieldType,
|
|
||||||
Table,
|
|
||||||
TableRequest,
|
|
||||||
TableSourceType,
|
|
||||||
} from "@budibase/types"
|
|
||||||
import {
|
import {
|
||||||
DatabaseName,
|
DatabaseName,
|
||||||
getDatasource,
|
getDatasource,
|
||||||
|
@ -231,57 +225,6 @@ describe("mysql integrations", () => {
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
describe("POST /api/tables/", () => {
|
|
||||||
it("will rename a column", async () => {
|
|
||||||
await makeRequest("post", "/api/tables/", primaryMySqlTable)
|
|
||||||
|
|
||||||
let renameColumnOnTable: TableRequest = {
|
|
||||||
...primaryMySqlTable,
|
|
||||||
schema: {
|
|
||||||
id: {
|
|
||||||
name: "id",
|
|
||||||
type: FieldType.AUTO,
|
|
||||||
autocolumn: true,
|
|
||||||
externalType: "unsigned integer",
|
|
||||||
},
|
|
||||||
name: {
|
|
||||||
name: "name",
|
|
||||||
type: FieldType.STRING,
|
|
||||||
externalType: "text",
|
|
||||||
},
|
|
||||||
description: {
|
|
||||||
name: "description",
|
|
||||||
type: FieldType.STRING,
|
|
||||||
externalType: "text",
|
|
||||||
},
|
|
||||||
age: {
|
|
||||||
name: "age",
|
|
||||||
type: FieldType.NUMBER,
|
|
||||||
externalType: "float(8,2)",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
|
|
||||||
const response = await makeRequest(
|
|
||||||
"post",
|
|
||||||
"/api/tables/",
|
|
||||||
renameColumnOnTable
|
|
||||||
)
|
|
||||||
|
|
||||||
const ds = (
|
|
||||||
await makeRequest("post", `/api/datasources/${datasource._id}/schema`)
|
|
||||||
).body.datasource
|
|
||||||
|
|
||||||
expect(response.status).toEqual(200)
|
|
||||||
expect(Object.keys(ds.entities![primaryMySqlTable.name].schema)).toEqual([
|
|
||||||
"id",
|
|
||||||
"name",
|
|
||||||
"description",
|
|
||||||
"age",
|
|
||||||
])
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
describe("POST /api/datasources/:datasourceId/schema", () => {
|
describe("POST /api/datasources/:datasourceId/schema", () => {
|
||||||
let tableName: string
|
let tableName: string
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue