24 lines
452 B
TypeScript
24 lines
452 B
TypeScript
import axios from "axios";
|
|
import { config } from "../config";
|
|
|
|
export default async (
|
|
databaseId: string,
|
|
upQuery: string,
|
|
downQuery: string
|
|
) => {
|
|
try {
|
|
const response = await axios.post(
|
|
`${config.url}/database/migration/create`,
|
|
{
|
|
databaseId,
|
|
up: upQuery,
|
|
down: downQuery,
|
|
}
|
|
);
|
|
|
|
return response.data;
|
|
} catch (error) {
|
|
console.error("Error in creating migration:", error);
|
|
}
|
|
};
|