feat: enhance database management with new migration and database node functionalities, including CRUD operations and test cases
This commit is contained in:
@ -1,12 +1,20 @@
|
||||
import axios from "axios";
|
||||
import { config } from "../config";
|
||||
|
||||
export default async (token: string, tables: any) => {
|
||||
export default async (
|
||||
databaseId: string,
|
||||
upQuery: string,
|
||||
downQuery: string
|
||||
) => {
|
||||
try {
|
||||
const response = await axios.post(`${config.url}/migrations/create`, {
|
||||
token,
|
||||
tables,
|
||||
});
|
||||
const response = await axios.post(
|
||||
`${config.url}/database/migration/create`,
|
||||
{
|
||||
databaseId,
|
||||
up: upQuery,
|
||||
down: downQuery,
|
||||
}
|
||||
);
|
||||
|
||||
return response.data;
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user