Fix bugs, improve schema gen
This commit is contained in:
Vendored
+27
@@ -206,7 +206,15 @@ export type BUN_MARIADB_FieldSchemaType = {
|
||||
patternFlags?: string;
|
||||
onUpdate?: string;
|
||||
onUpdateLiteral?: string;
|
||||
/**
|
||||
* @deprecated Use `foreignKey.onDelete`. Still honored as the foreign
|
||||
* key's ON DELETE action when `foreignKey.onDelete` is not set.
|
||||
*/
|
||||
onDelete?: string;
|
||||
/**
|
||||
* @deprecated Use `foreignKey.onDelete`. Still honored as the foreign
|
||||
* key's ON DELETE action when `foreignKey.onDelete` is not set.
|
||||
*/
|
||||
onDeleteLiteral?: string;
|
||||
cssFiles?: string[];
|
||||
/**
|
||||
@@ -224,13 +232,32 @@ export type BUN_MARIADB_FieldSchemaType = {
|
||||
/**
|
||||
* Defines a foreign key relationship from one field to another table column.
|
||||
*/
|
||||
export declare const BUN_MARIADB_ForeignKeyRules: readonly ["CASCADE", "SET NULL", "RESTRICT", "NO ACTION"];
|
||||
export type BUN_MARIADB_ForeignKeyRule = (typeof BUN_MARIADB_ForeignKeyRules)[number];
|
||||
export interface BUN_MARIADB_ForeignKeyType {
|
||||
foreignKeyName?: string;
|
||||
destinationTableName?: string;
|
||||
destinationTableColumnName?: string;
|
||||
destinationTableColumnType?: string;
|
||||
/**
|
||||
* Shorthand for `onDelete: "CASCADE"`. Ignored when `onDelete` is set.
|
||||
*/
|
||||
cascadeDelete?: boolean;
|
||||
/**
|
||||
* Shorthand for `onUpdate: "CASCADE"`. Ignored when `onUpdate` is set.
|
||||
*/
|
||||
cascadeUpdate?: boolean;
|
||||
/**
|
||||
* Referential action when the referenced row is deleted.
|
||||
* Defaults to `CASCADE` when `cascadeDelete` is true, else `RESTRICT`.
|
||||
* `SET NULL` requires a nullable column.
|
||||
*/
|
||||
onDelete?: BUN_MARIADB_ForeignKeyRule;
|
||||
/**
|
||||
* Referential action when the referenced key is updated.
|
||||
* Defaults to `CASCADE` when `cascadeUpdate` is true, else `RESTRICT`.
|
||||
*/
|
||||
onUpdate?: BUN_MARIADB_ForeignKeyRule;
|
||||
}
|
||||
export declare const MariaDBIndexTypes: readonly ["BTREE", "HASH", "FULLTEXT", "SPATIAL", "VECTOR"];
|
||||
export type MariaDBIndexType = (typeof MariaDBIndexTypes)[number];
|
||||
|
||||
Vendored
+9
@@ -79,6 +79,15 @@ export const BUN_MARIADB_DATATYPES = [
|
||||
{ value: "SET" },
|
||||
{ value: "VECTOR" },
|
||||
];
|
||||
/**
|
||||
* Defines a foreign key relationship from one field to another table column.
|
||||
*/
|
||||
export const BUN_MARIADB_ForeignKeyRules = [
|
||||
"CASCADE",
|
||||
"SET NULL",
|
||||
"RESTRICT",
|
||||
"NO ACTION",
|
||||
];
|
||||
export const MariaDBIndexTypes = [
|
||||
"BTREE",
|
||||
"HASH",
|
||||
|
||||
Reference in New Issue
Block a user