pub struct ForeignKeyOptions {
pub on_delete: Option<String>,
pub on_update: Option<String>,
}Expand description
外键选项构建器(Phinx 风格链式配置)
Fields§
§on_delete: Option<String>§on_update: Option<String>Implementations§
Source§impl ForeignKeyOptions
impl ForeignKeyOptions
Sourcepub fn on_delete_cascade(self) -> ForeignKeyOptions
pub fn on_delete_cascade(self) -> ForeignKeyOptions
ON DELETE CASCADE
Sourcepub fn on_delete_set_null(self) -> ForeignKeyOptions
pub fn on_delete_set_null(self) -> ForeignKeyOptions
ON DELETE SET NULL
Sourcepub fn on_delete_restrict(self) -> ForeignKeyOptions
pub fn on_delete_restrict(self) -> ForeignKeyOptions
ON DELETE RESTRICT
Sourcepub fn on_delete_no_action(self) -> ForeignKeyOptions
pub fn on_delete_no_action(self) -> ForeignKeyOptions
ON DELETE NO ACTION
Sourcepub fn on_update_cascade(self) -> ForeignKeyOptions
pub fn on_update_cascade(self) -> ForeignKeyOptions
ON UPDATE CASCADE
Sourcepub fn on_delete(self, action: impl Into<String>) -> ForeignKeyOptions
pub fn on_delete(self, action: impl Into<String>) -> ForeignKeyOptions
自定义 ON DELETE 规则
Sourcepub fn on_update(self, action: impl Into<String>) -> ForeignKeyOptions
pub fn on_update(self, action: impl Into<String>) -> ForeignKeyOptions
自定义 ON UPDATE 规则
Trait Implementations§
Source§impl Clone for ForeignKeyOptions
impl Clone for ForeignKeyOptions
Source§fn clone(&self) -> ForeignKeyOptions
fn clone(&self) -> ForeignKeyOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ForeignKeyOptions
impl Debug for ForeignKeyOptions
Source§impl Default for ForeignKeyOptions
impl Default for ForeignKeyOptions
Source§fn default() -> ForeignKeyOptions
fn default() -> ForeignKeyOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ForeignKeyOptions
impl RefUnwindSafe for ForeignKeyOptions
impl Send for ForeignKeyOptions
impl Sync for ForeignKeyOptions
impl Unpin for ForeignKeyOptions
impl UnsafeUnpin for ForeignKeyOptions
impl UnwindSafe for ForeignKeyOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more