Updates
This commit is contained in:
+1
-23
@@ -6,31 +6,9 @@ import typedef from "./typedef";
|
||||
import backup from "./backup";
|
||||
import restore from "./restore";
|
||||
import admin from "./admin";
|
||||
import type {
|
||||
BUN_MARIADB_DatabaseSchemaType,
|
||||
BunMariaDBConfig,
|
||||
} from "../types";
|
||||
import init from "../functions/init";
|
||||
|
||||
/**
|
||||
* # Declare Global Variables
|
||||
*/
|
||||
declare global {
|
||||
var CONFIG: BunMariaDBConfig;
|
||||
var DB_SCHEMA: BUN_MARIADB_DatabaseSchemaType;
|
||||
}
|
||||
|
||||
await init();
|
||||
|
||||
if (!global.CONFIG) {
|
||||
console.error(`Couldn't grab global Config.`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
if (!global.DB_SCHEMA) {
|
||||
console.error(`Couldn't grab Database Schema.`);
|
||||
process.exit(1);
|
||||
}
|
||||
init();
|
||||
|
||||
/**
|
||||
* # Describe Program
|
||||
|
||||
@@ -7,6 +7,7 @@ import _ from "lodash";
|
||||
import appendDefaultFieldsToDbSchema from "../utils/append-default-fields-to-db-schema";
|
||||
import chalk from "chalk";
|
||||
import { writeLiveSchema } from "../functions/live-schema";
|
||||
import createDBSchema from "../lib/schema/create-db-schema";
|
||||
|
||||
export default function () {
|
||||
return new Command("schema")
|
||||
@@ -31,12 +32,14 @@ export default function () {
|
||||
dbSchema,
|
||||
});
|
||||
|
||||
const manager = new MariaDBSchemaManager({
|
||||
schema: finaldbSchema,
|
||||
});
|
||||
// const manager = new MariaDBSchemaManager({
|
||||
// schema: finaldbSchema,
|
||||
// });
|
||||
|
||||
await manager.syncSchema();
|
||||
manager.close();
|
||||
// await manager.syncSchema();
|
||||
// manager.close();
|
||||
|
||||
await createDBSchema({ db_schema: finaldbSchema });
|
||||
|
||||
if (isTypeDef && config.typedef_file_path) {
|
||||
const out_file = path.resolve(
|
||||
|
||||
Reference in New Issue
Block a user