Updates
This commit is contained in:
@@ -24,37 +24,6 @@ export default async function handleUniqueConstraintsCreateDbFromSchema({
|
||||
tableName,
|
||||
tableUniqueConstraints,
|
||||
}: Param) {
|
||||
/**
|
||||
* # Delete All Existing Unique Constraints
|
||||
*/
|
||||
// const allExistingUniqueConstraints = (await dbHandler({
|
||||
// query: `SHOW INDEXES FROM \`${dbFullName}\`.\`${tableName}\` WHERE Index_comment LIKE '%${AppData["UniqueConstraintComment"]}%'`,
|
||||
// })) as DSQL_MYSQL_SHOW_INDEXES_Type[] | null;
|
||||
|
||||
// if (allExistingUniqueConstraints?.[0]) {
|
||||
// for (let f = 0; f < allExistingUniqueConstraints.length; f++) {
|
||||
// const { Key_name } = allExistingUniqueConstraints[f];
|
||||
|
||||
// try {
|
||||
// const existingKeyInSchema = tableUniqueConstraints?.find(
|
||||
// (indexObject) => indexObject.alias === Key_name
|
||||
// );
|
||||
// if (!existingKeyInSchema)
|
||||
// throw new Error(
|
||||
// `This Index(${Key_name}) Has been Deleted!`
|
||||
// );
|
||||
// } catch (error) {
|
||||
// /**
|
||||
// * @description Drop Index: This happens when the MYSQL index is not
|
||||
// * present in the datasquirel DB schema
|
||||
// */
|
||||
// await dbHandler({
|
||||
// query: `ALTER TABLE \`${dbFullName}\`.\`${tableName}\` DROP INDEX \`${Key_name}\``,
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* # Re-Add New Constraints
|
||||
*/
|
||||
|
||||
@@ -59,7 +59,7 @@ export type DSQL_DATASQUIREL_API_KEYS = {
|
||||
name?: string;
|
||||
slug?: string;
|
||||
key?: string;
|
||||
scope?: "readOnly" | "fullAccess";
|
||||
scope?: "readOnly" | "fullAccess" | "media";
|
||||
all_dbs?: 0 | 1;
|
||||
media_only?: 0 | 1;
|
||||
csrf?: string;
|
||||
@@ -415,4 +415,6 @@ export type DSQL_DATASQUIREL_USER_PRIVATE_MEDIA_KEYS = {
|
||||
date_updated?: string;
|
||||
date_updated_code?: number;
|
||||
date_updated_timestamp?: string;
|
||||
}
|
||||
}
|
||||
|
||||
export type DSQL_DATASQUIREL_ALL_TYPEDEFS = DSQL_DATASQUIREL_USERS & DSQL_DATASQUIREL_API_KEYS & DSQL_DATASQUIREL_API_KEYS_SCOPED_RESOURCES & DSQL_DATASQUIREL_INVITATIONS & DSQL_DATASQUIREL_USER_DATABASES & DSQL_DATASQUIREL_USER_DATABASE_TABLES & DSQL_DATASQUIREL_USER_MEDIA & DSQL_DATASQUIREL_USER_PRIVATE_FOLDERS & DSQL_DATASQUIREL_DELEGATED_USERS & DSQL_DATASQUIREL_DELEGATED_RESOURCES & DSQL_DATASQUIREL_MARIADB_USER_PRIVILEGES & DSQL_DATASQUIREL_UNSUBSCRIBES & DSQL_DATASQUIREL_NOTIFICATIONS & DSQL_DATASQUIREL_DELETED_API_KEYS & DSQL_DATASQUIREL_SERVERS & DSQL_DATASQUIREL_PROCESS_QUEUE & DSQL_DATASQUIREL_BACKUPS & DSQL_DATASQUIREL_MARIADB_USERS & DSQL_DATASQUIREL_MARIADB_USER_DATABASES & DSQL_DATASQUIREL_MARIADB_USER_TABLES & DSQL_DATASQUIREL_USER_PRIVATE_MEDIA_KEYS
|
||||
@@ -101,10 +101,35 @@ export interface DSQL_TableSchemaType {
|
||||
indexes?: DSQL_IndexSchemaType[];
|
||||
uniqueConstraints?: DSQL_UniqueConstraintSchemaType[];
|
||||
childrenTables?: DSQL_ChildrenTablesType[];
|
||||
/**
|
||||
* Whether this is a child table
|
||||
*/
|
||||
childTable?: boolean;
|
||||
updateData?: boolean;
|
||||
/**
|
||||
* ID of the parent table
|
||||
*/
|
||||
childTableId?: string | number;
|
||||
/**
|
||||
* ID of the parent table
|
||||
*/
|
||||
parentTableId?: string | number;
|
||||
/**
|
||||
* ID of the Database of parent table
|
||||
*/
|
||||
parentTableDbId?: string | number;
|
||||
/**
|
||||
* Name of the Database of parent table
|
||||
*/
|
||||
parentTableDbName?: string;
|
||||
/**
|
||||
* Name of the parent table
|
||||
*/
|
||||
parentTableName?: string;
|
||||
tableNameOld?: string;
|
||||
/**
|
||||
* ID of the Database of parent table
|
||||
*/
|
||||
childTableDbId?: string | number;
|
||||
collation?: (typeof MariaDBCollations)[number];
|
||||
isVector?: boolean;
|
||||
@@ -991,6 +1016,7 @@ export type ApiKeyObject = {
|
||||
sign?: string;
|
||||
date_code?: number;
|
||||
error?: string;
|
||||
media_only?: boolean;
|
||||
};
|
||||
|
||||
export type AddApiKeyRequestBody = {
|
||||
@@ -1732,7 +1758,7 @@ export type PagePropsType = {
|
||||
mediaCurrentFolder?: string | null;
|
||||
appData?: DsqlAppData | null;
|
||||
staticHost?: string | null;
|
||||
folders?: string[] | null;
|
||||
folders?: LocalFolderType[] | null;
|
||||
activeClonedTable?: boolean | null;
|
||||
tableEntries?: DefaultEntryType[] | null;
|
||||
tableEntriesCount?: number | null;
|
||||
@@ -1766,6 +1792,12 @@ export type PagePropsType = {
|
||||
docsObject?: DocsServerProps | null;
|
||||
docsPages?: DocsLinkType[] | null;
|
||||
docsPageEditURL?: string | null;
|
||||
isFolderPrivate?: boolean;
|
||||
};
|
||||
|
||||
export type LocalFolderType = {
|
||||
name: string;
|
||||
isPrivate: boolean;
|
||||
};
|
||||
|
||||
export type ResponseQueryObject = {
|
||||
@@ -2535,6 +2567,7 @@ export type AddMediaAPIBody = {
|
||||
export type ReplaceMediaAPIBody = {
|
||||
mediaId: number;
|
||||
media: MediaUploadDataType;
|
||||
is_media_folder_private: boolean;
|
||||
};
|
||||
|
||||
export const TargetMediaParadigms = ["info", "preview"] as const;
|
||||
@@ -3200,3 +3233,15 @@ export type SQLInsertGenParams = {
|
||||
tableName: string;
|
||||
dbFullName?: string;
|
||||
};
|
||||
|
||||
export type APIReqParams = {
|
||||
media_id?: number;
|
||||
is_folder_private?: boolean;
|
||||
is_file_private?: boolean;
|
||||
raw_media?: MediaUploadDataType[];
|
||||
media_type?: "video" | "image" | "file";
|
||||
is_media_folder_private?: boolean;
|
||||
folder?: string;
|
||||
is_media_private?: boolean;
|
||||
force_update_media?: boolean;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user